summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/java/com/sun/gluegen/JavaMethodBindingEmitter.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java b/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java
index 3cbafc0..08da5d5 100644
--- a/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java
+++ b/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java
@@ -412,7 +412,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter
firstBuffer = false;
writer.println(" boolean _direct = BufferFactory.isDirect(" + getArgumentName(i) + ");");
} else {
- writer.println(" if (_direct != BufferFactory.isDirect(" + getArgumentName(i) + "))");
+ writer.println(" if (" + getArgumentName(i) + " != null && _direct != BufferFactory.isDirect(" + getArgumentName(i) + "))");
writer.println(" throw new " + getRuntimeExceptionType() +
"(\"Argument \\\"" + getArgumentName(i) +
"\\\" : Buffers passed to this method must all be either direct or indirect\");");