From 1f4171ef3019ce8de945129d74363def12e128a3 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 25 Feb 2011 05:52:05 +0100 Subject: Avoid NPE (pairs with 6188d6a385056adade49fcb6d8247f94f96d402e) --- src/newt/classes/jogamp/newt/awt/AWTWindow.java | 9 +++++---- 1 file 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() { -- cgit v1.2.3