summaryrefslogtreecommitdiffstats
path: root/src/newt/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-02-25 05:52:05 +0100
committerSven Gothel <[email protected]>2011-02-25 05:52:05 +0100
commit1f4171ef3019ce8de945129d74363def12e128a3 (patch)
tree9c9b4f04ce2bd2a0dd9ccc6eb29cd8b0159d6d7c /src/newt/classes
parentc0dc6dd0571684e74b08ab28b5558df47e40ff7d (diff)
Avoid NPE (pairs with 6188d6a385056adade49fcb6d8247f94f96d402e)
Diffstat (limited to 'src/newt/classes')
-rw-r--r--src/newt/classes/jogamp/newt/awt/AWTWindow.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/newt/classes/jogamp/newt/awt/AWTWindow.java b/src/newt/classes/jogamp/newt/awt/AWTWindow.java
index 0a6a557f7..ae18fcfa6 100644
--- a/src/newt/classes/jogamp/newt/awt/AWTWindow.java
+++ b/src/newt/classes/jogamp/newt/awt/AWTWindow.java
@@ -172,10 +172,11 @@ public class AWTWindow extends WindowImpl {
((AWTScreen)getScreen()).setAWTGraphicsScreen((AWTGraphicsScreen)config.getScreen());
((AWTDisplay)getScreen().getDisplay()).setAWTGraphicsDevice((AWTGraphicsDevice)config.getScreen().getDevice());
- DisplayMode mode = ((AWTGraphicsDevice)config.getScreen().getDevice()).getGraphicsDevice().getDisplayMode();
- int w = mode.getWidth();
- int h = mode.getHeight();
- ((AWTScreen)getScreen()).setScreenSize(w, h);
+ final DisplayMode mode = ((AWTGraphicsDevice)config.getScreen().getDevice()).getGraphicsDevice().getDisplayMode();
+ if(null != mode) {
+ ((AWTScreen)getScreen()).setScreenSize(mode.getWidth(), mode.getHeight());
+ }
+
}
public javax.media.nativewindow.util.Insets getInsets() {