Error message when you create a 0x0 Image

Hi all,

I’ve spent a long time to debug my code because of a LWJGL exception :

Number of remaining buffer elements is 0, must be at least 4. Because at most 4 elements can be returned, a buffer with at least 4 elements is required, regardless of actual returned element count

Finally, I understood my mistake : I was created an Image with 0 width and 0 height which is not allowed if I read the javadoc :

Image defines a data format for a graphical image. The image
is defined by a format, a height and width, and the image data. The width and
height must be greater than 0. The data is contained in a byte buffer, and
should be packed before creation of the image object.

Shouldn’t there be an exception or a warning for that?

Thanks for reading !

Ben