diff options
Diffstat (limited to 'plugins/dex/python/format.c')
-rw-r--r-- | plugins/dex/python/format.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/plugins/dex/python/format.c b/plugins/dex/python/format.c index 81db02f..8bcd2fa 100644 --- a/plugins/dex/python/format.c +++ b/plugins/dex/python/format.c @@ -100,13 +100,20 @@ static PyObject *py_dex_format_new(PyTypeObject *type, PyObject *args, PyObject content = G_BIN_CONTENT(pygobject_get(content_obj)); format = g_dex_format_new(content); - assert(format != NULL); - result = pygobject_new(G_OBJECT(format)); + if (format == NULL) + { + result = Py_None; + Py_INCREF(result); + } - g_object_unref(format); + else + { + result = pygobject_new(G_OBJECT(format)); + g_object_unref(format); + } - return (PyObject *)result; + return result; } |