aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-12-05 07:05:32 +0100
committerSven Gothel <[email protected]>2019-12-05 07:05:32 +0100
commitbfc152be4203eeceebea919aff9513d33213c802 (patch)
treec51156235a4e3e325fb129f2428cc652479d96c9 /src/newt/classes/com/jogamp
parenteaa81d524e9be6af9867c8b6750505c8660a6651 (diff)
NEWTDemoListener: Fix NPE
Diffstat (limited to 'src/newt/classes/com/jogamp')
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/util/NEWTDemoListener.java11
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;