From 51f055ae70f927638ac304436e9a1f02a1c0b570 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 12 Oct 2012 23:28:52 +0200 Subject: GLCanvas: Avoid NPE in debug mode @ reshape (duh) --- src/jogl/classes/javax/media/opengl/awt/GLCanvas.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/jogl/classes/javax') diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java index 31c91e046..1e9fcc95e 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java @@ -654,7 +654,9 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing super.reshape(x, y, width, height); if(DEBUG) { - System.err.println("GLCanvas.sizeChanged: ("+Thread.currentThread().getName()+"): "+width+"x"+height+" - surfaceHandle 0x"+Long.toHexString(getNativeSurface().getSurfaceHandle())); + final NativeSurface ns = getNativeSurface(); + final long nsH = null != ns ? ns.getSurfaceHandle() : 0; + System.err.println("GLCanvas.sizeChanged: ("+Thread.currentThread().getName()+"): "+width+"x"+height+" - surfaceHandle 0x"+Long.toHexString(nsH)); // Thread.dumpStack(); } if( validateGLDrawable() ) { -- cgit v1.2.3