diff options
Diffstat (limited to 'source3/python')
-rw-r--r-- | source3/python/py_spoolss_printers_conv.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/python/py_spoolss_printers_conv.c b/source3/python/py_spoolss_printers_conv.c index 247db65b1e..760896fcde 100644 --- a/source3/python/py_spoolss_printers_conv.c +++ b/source3/python/py_spoolss_printers_conv.c @@ -227,8 +227,14 @@ BOOL py_from_PRINTER_INFO_2(PyObject **dict, PRINTER_INFO_2 *info) if (py_from_SECDESC(&obj, info->secdesc)) PyDict_SetItemString(*dict, "security_descriptor", obj); - if (py_from_DEVICEMODE(&obj, info->devmode)) - PyDict_SetItemString(*dict, "device_mode", obj); + /* Bong! The devmode could be NULL */ + + if (info->devmode) + py_from_DEVICEMODE(&obj, info->devmode); + else + obj = PyDict_New(); + + PyDict_SetItemString(*dict, "device_mode", obj); PyDict_SetItemString(*dict, "level", PyInt_FromLong(2)); |