diff options
author | Sven Gothel <[email protected]> | 2019-12-05 07:05:32 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-12-05 07:05:32 +0100 |
commit | bfc152be4203eeceebea919aff9513d33213c802 (patch) | |
tree | c51156235a4e3e325fb129f2428cc652479d96c9 /src/newt/classes/com/jogamp | |
parent | eaa81d524e9be6af9867c8b6750505c8660a6651 (diff) |
NEWTDemoListener: Fix NPE
Diffstat (limited to 'src/newt/classes/com/jogamp')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java b/src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java index 6c07b3626..ee6b59fc0 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java +++ b/src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java @@ -123,10 +123,13 @@ public class NEWTDemoListener extends WindowAdapter implements KeyListener, Mous e.setConsumed(true); glWindow.invokeOnCurrentThread(new Runnable() { public void run() { - if(glWindow.getAnimator().isPaused()) { - glWindow.getAnimator().resume(); - } else { - glWindow.getAnimator().pause(); + final GLAnimatorControl anim = glWindow.getAnimator(); + if( null != anim ) { + if( anim.isPaused()) { + anim.resume(); + } else { + anim.pause(); + } } } } ); break; |