Jogamp
Bug 1247: JAWTWindow fail early w/ useful info: setAWTGraphicsConfiguration(..) if...
authorSven Gothel <sgothel@jausoft.com>
Fri, 9 Oct 2015 04:08:06 +0000 (06:08 +0200)
committerSven Gothel <sgothel@jausoft.com>
Fri, 9 Oct 2015 04:08:06 +0000 (06:08 +0200)
src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java

index 0d6e4e7..1dce742 100644 (file)
@@ -302,6 +302,9 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
         System.err.println(jawtStr2("setAWTGraphicsConfiguration")+": "+this.awtConfig+" -> "+config);
         // Thread.dumpStack();
     }
+    if( null == awtConfig ) {
+        throw new IllegalArgumentException(jawtStr2("")+": null config");
+    }
     this.awtConfig = config;
   }
   /**
@@ -775,6 +778,9 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
 
   @Override
   public final AbstractGraphicsConfiguration getGraphicsConfiguration() {
+    if( null == awtConfig ) {
+        throw new NativeWindowException(jawtStr2("")+": null awtConfig, invalidated");
+    }
     return awtConfig.getNativeGraphicsConfiguration();
   }
 
http://JogAmp.org git info: FAQ, tutorial and man pages.