NullReferenceException replaced with ArgumentNullException
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7040 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f71759a078
commit
fb00ecc75d
2 changed files with 4 additions and 4 deletions
|
|
@ -168,7 +168,7 @@ $1 = &temp; %}
|
||||||
%typemap(in, canthrow=1) SWIGTYPE ($&1_type argp)
|
%typemap(in, canthrow=1) SWIGTYPE ($&1_type argp)
|
||||||
%{ argp = ($&1_ltype)$input;
|
%{ argp = ($&1_ltype)$input;
|
||||||
if (!argp) {
|
if (!argp) {
|
||||||
SWIG_CSharpSetPendingException(SWIG_CSharpNullReferenceException, "Attempt to dereference null $1_type");
|
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null $1_type", 0);
|
||||||
return $null;
|
return $null;
|
||||||
}
|
}
|
||||||
$1 = *argp; %}
|
$1 = *argp; %}
|
||||||
|
|
@ -188,7 +188,7 @@ $1 = &temp; %}
|
||||||
%typemap(in) SWIGTYPE (CLASS::*) %{ $1 = *($&1_ltype)&$input; %}
|
%typemap(in) SWIGTYPE (CLASS::*) %{ $1 = *($&1_ltype)&$input; %}
|
||||||
%typemap(in, canthrow=1) SWIGTYPE & %{ $1 = ($1_ltype)$input;
|
%typemap(in, canthrow=1) SWIGTYPE & %{ $1 = ($1_ltype)$input;
|
||||||
if(!$1) {
|
if(!$1) {
|
||||||
SWIG_CSharpSetPendingException(SWIG_CSharpNullReferenceException, "$1_type reference is null");
|
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type type is null", 0);
|
||||||
return $null;
|
return $null;
|
||||||
} %}
|
} %}
|
||||||
%typemap(out) SWIGTYPE *, SWIGTYPE & %{ $result = (void *)$1; %}
|
%typemap(out) SWIGTYPE *, SWIGTYPE & %{ $result = (void *)$1; %}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class string;
|
||||||
|
|
||||||
%typemap(in, canthrow=1) string
|
%typemap(in, canthrow=1) string
|
||||||
%{ if (!$input) {
|
%{ if (!$input) {
|
||||||
SWIG_CSharpSetPendingException(SWIG_CSharpNullReferenceException, "null string");
|
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
|
||||||
return $null;
|
return $null;
|
||||||
}
|
}
|
||||||
$1 = std::string($input); %}
|
$1 = std::string($input); %}
|
||||||
|
|
@ -64,7 +64,7 @@ class string;
|
||||||
|
|
||||||
%typemap(in, canthrow=1) const string &
|
%typemap(in, canthrow=1) const string &
|
||||||
%{ if (!$input) {
|
%{ if (!$input) {
|
||||||
SWIG_CSharpSetPendingException(SWIG_CSharpNullReferenceException, "null string");
|
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
|
||||||
return $null;
|
return $null;
|
||||||
}
|
}
|
||||||
std::string $1_str($input);
|
std::string $1_str($input);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue