summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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";