=== modified file 'java/ndbj.i'
--- a/java/ndbj.i	2008-05-08 16:10:25 +0000
+++ b/java/ndbj.i	2008-05-20 16:41:08 +0000
@@ -34,6 +34,9 @@
 %rename NdbScanOperation NdbScanOperationImpl;
 %rename NdbTransaction NdbTransactionImpl;
 
+
+
+
 %include "arrays_java.i"
 %include "decimal.i"
 
@@ -82,6 +85,14 @@
         }
 %}
 
+%typemap(in) SWIGTYPE * %{
+  /* Prevent SEGV on null pointers */
+  if ($input == 0) {
+    NDB_exception(NdbApiException,"Object is NULL. This state is usually encountered when using an object after it has been closed");
+    return $null;
+  }
+  $1=*($1_ltype*)&$input;
+%}
 
 %include "NdbClusterConnection.i"
 %include "Ndb.i"



