From e0089921c28dc36f56eb584b57803ea3740d2172 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 6 Jan 2006 14:09:14 +0000 Subject: [PATCH] Fix for directors - where a class returned by value git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8253 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/java/java.swg | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Lib/java/java.swg b/Lib/java/java.swg index 2c5b1379c..9b8ab2fef 100644 --- a/Lib/java/java.swg +++ b/Lib/java/java.swg @@ -583,13 +583,12 @@ } $1 = *argp; %} -%typemap(directorout) SWIGTYPE ($1_ltype argp) -%{ argp = *($&1_ltype)(void *)&$input; - if (!argp) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null $1_type"); +%typemap(directorout) SWIGTYPE +%{ if (!$input) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Unexpected null return for type $1_type"); return $null; } - $1 = argp; %} + $1 = *($&1_ltype)(void *)&$input; %} %typemap(out) SWIGTYPE #ifdef __cplusplus