diff options
author | Sven Göthel <[email protected]> | 2024-01-05 13:04:29 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-01-05 13:04:29 +0100 |
commit | dccb9a85e39cf82bd32ef28cb0202e2d486328ec (patch) | |
tree | a01544f99775c9ecb9087f7c05bf1922e7a217c3 /src | |
parent | e3b10d335cc2fb659bb5bd3d8ab82e93eb36080c (diff) | |
parent | d56cd13883c2af1f42906a5327c78b1a7c684012 (diff) |
Merge remote-tracking branch 'Mathieu_Fery/1482-npe-on-java-callback-call-with-native-null-ptr'
Diffstat (limited to 'src')
-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" ); } |