summaryrefslogtreecommitdiff
path: root/plugins/dex/python
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-05-07 15:00:14 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-05-07 15:00:14 (GMT)
commit83da8ea946dc50941838ec8b3951108f5e16642e (patch)
tree06d30655b95e856f2def3da0fab24067271de8b0 /plugins/dex/python
parentc136e2c4c1ad02ea2e363fbe71ce54c6255793e2 (diff)
Described binary formats and improved their loading.
Diffstat (limited to 'plugins/dex/python')
-rw-r--r--plugins/dex/python/format.c15
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;
}