diff --git a/src/java/org/lwjgl/opengl/LinuxDisplay.java b/src/java/org/lwjgl/opengl/LinuxDisplay.java index 30728fa3e..f0c3a6e28 100644 --- a/src/java/org/lwjgl/opengl/LinuxDisplay.java +++ b/src/java/org/lwjgl/opengl/LinuxDisplay.java @@ -943,7 +943,7 @@ public DisplayMode[] getAvailableDisplayModes() throws LWJGLException { // nGetAvailableDisplayModes cannot be trusted. Use it only for bitsPerPixel DisplayMode[] nDisplayModes = nGetAvailableDisplayModes(getDisplay(), getDefaultScreen(), current_displaymode_extension); int bpp = 24; - if (nDisplayModes.length > 0) { + if (nDisplayModes != null && nDisplayModes.length > 0) { bpp = nDisplayModes[0].getBitsPerPixel(); } // get the resolutions and frequencys from XRandR