summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-09-22 05:14:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:58 -0500
commit42b5bdf75fe4974cb2e765f887c27d988d5aa28f (patch)
treed5e766faa9356235b54fac8da36b5cced1fb8f92 /source4
parente6e4e3e0a3f2222efeca7bee535fe26162c974c8 (diff)
downloadsamba-42b5bdf75fe4974cb2e765f887c27d988d5aa28f.tar.gz
samba-42b5bdf75fe4974cb2e765f887c27d988d5aa28f.tar.bz2
samba-42b5bdf75fe4974cb2e765f887c27d988d5aa28f.zip
r2496: Check that reference parameters are not None.
(This used to be commit a2ab6c5ef9cc6db27fc8c73e6117f0f7a116d563)
Diffstat (limited to 'source4')
-rw-r--r--source4/build/pidl/swig.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/source4/build/pidl/swig.pm b/source4/build/pidl/swig.pm
index ae52ab3d9d..dd007ffbd4 100644
--- a/source4/build/pidl/swig.pm
+++ b/source4/build/pidl/swig.pm
@@ -261,7 +261,15 @@ sub ParseFunction($)
$result .= "\tmemset(s, 0, sizeof(struct $fn->{NAME}));\n\n";
foreach my $e (@{$fn->{DATA}}) {
- $result .= FieldFromPython($e, "in.") if util::has_property($e, "in")
+ if (util::has_property($e, "in")) {
+ if (util::has_property($e, "ref")) {
+ $result .= "\tif (PyDict_GetItemString(obj, \"$e->{NAME}\") == Py_None) {\n";
+ $result .= "\t\tPyErr_Format(PyExc_ValueError, \"Key '$e->{NAME}' cannot be None\");\n";
+ $result .= "\t\treturn NULL;\n";
+ $result .= "\t}\n";
+ }
+ $result .= FieldFromPython($e, "in.") ;
+ }
}
$result .= "\n";