diff options
Diffstat (limited to 'src/java/com')
-rw-r--r-- | src/java/com/jogamp/gluegen/JavaCallbackEmitter.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/java/com/jogamp/gluegen/JavaCallbackEmitter.java b/src/java/com/jogamp/gluegen/JavaCallbackEmitter.java index 247d3ac..8263372 100644 --- a/src/java/com/jogamp/gluegen/JavaCallbackEmitter.java +++ b/src/java/com/jogamp/gluegen/JavaCallbackEmitter.java @@ -878,7 +878,8 @@ public final class JavaCallbackEmitter { final String baseArgName = info.cbFuncBinding.getArgumentName(i); if( i != info.cbFuncUserParamIdx && currentJavaType.isCompoundTypeWrapper() ) { final String cBaseArgName = CodeGenUtils.capitalizeString( baseArgName ); - unit.emit( "(*env)->CallStaticObjectMethod(env, cbClazzArg" + cBaseArgName + ", cbMethodArg" + cBaseArgName + ", " + baseArgName + "_jni)" ); + final String jniArgName = baseArgName + "_jni"; + unit.emit( jniArgName + " != NULL ? " + "(*env)->CallStaticObjectMethod(env, cbClazzArg" + cBaseArgName + ", cbMethodArg" + cBaseArgName + ", " + jniArgName + ") : NULL" ); } else { unit.emit( baseArgName + "_jni" ); } |