Skip to content

Commit

Permalink
Avoids NPE in two OpenGL components
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisDrogoul committed Dec 19, 2021
1 parent ddd2907 commit d191418
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -14,6 +14,7 @@

import com.jogamp.opengl.fixedfunc.GLMatrixFunc;

import msi.gama.common.interfaces.IDisplaySynchronizer;
import msi.gama.common.interfaces.ILayer;
import msi.gama.util.GamaMapFactory;
import msi.gama.util.IMap;
Expand Down Expand Up @@ -130,7 +131,8 @@ public void draw(final OpenGL gl) {
});
gl.setZIncrement(0);
rendered = true;
gl.getRenderer().getSurface().synchronizer.signalRenderingIsFinished();
IDisplaySynchronizer sync = gl.getRenderer().getSurface().synchronizer;
if (sync != null) { sync.signalRenderingIsFinished(); }
gl.pop(GLMatrixFunc.GL_MODELVIEW);
}

Expand Down
Expand Up @@ -679,7 +679,7 @@ public void dispose() {
this.renderer = null;
GAMA.releaseScope(getScope());
setDisplayScope(null);
synchronizer.signalRenderingIsFinished();
if (synchronizer != null) { synchronizer.signalRenderingIsFinished(); }
}

@Override
Expand Down

0 comments on commit d191418

Please sign in to comment.