summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-12-19 00:40:45 +0000
committerKenneth Russel <[email protected]>2006-12-19 00:40:45 +0000
commit0e247d671de9953dccd7af6f3121e522a7174344 (patch)
tree000320c4d17d78ef0c2d1f1a2b623e1bcffd065f /src
parent4957c87a5d037e61580283520ac9c1ff6d7c3ccc (diff)
Fixed NullPointerException in new cached GLCapabilities code on X11
platforms pointed out by bleb on javagaming.org forums git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1028 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
-rw-r--r--src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java b/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java
index 4f92681d0..093f31232 100644
--- a/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java
+++ b/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java
@@ -191,8 +191,10 @@ public class X11GLDrawableFactory extends GLDrawableFactoryImpl {
}
// Store these away for later
for (int i = 0; i < infos.length; i++) {
- visualToGLCapsMap.put(new ScreenAndVisualIDKey(screen, infos[i].visualid()),
- caps[i].clone());
+ if (caps[i] != null) {
+ visualToGLCapsMap.put(new ScreenAndVisualIDKey(screen, infos[i].visualid()),
+ caps[i].clone());
+ }
}
int chosen = chooser.chooseCapabilities(capabilities, caps, recommendedIndex);
if (chosen < 0 || chosen >= caps.length) {