diff options
Diffstat (limited to 'source4/build')
-rw-r--r-- | source4/build/pidl/swig.pm | 5 |
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 { |