summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/build/pidl/swig.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/source4/build/pidl/swig.pm b/source4/build/pidl/swig.pm
index b3f2107001..c558287945 100644
--- a/source4/build/pidl/swig.pm
+++ b/source4/build/pidl/swig.pm
@@ -205,7 +205,10 @@ sub FieldToPython($$)
if ($e->{ARRAY_LEN} or util::has_property($e, "size_is")) {
$result .= ArrayToPython($e, $prefix);
} else {
- $result .= "\tPyDict_SetItemString(obj, \"$e->{NAME}\", $e->{TYPE}_to_python(*s->$prefix$e->{NAME}));\n";
+ $result .= "\tif (s->$prefix$e->{NAME})\n";
+ $result .= "\t\tPyDict_SetItemString(obj, \"$e->{NAME}\", $e->{TYPE}_to_python(*s->$prefix$e->{NAME}));\n";
+ $result .= "\telse\n";
+ $result .= "\t\tPyDict_SetItemString(obj, \"$e->{NAME}\", Py_None);\n";
}
}
} else {