summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/analysis
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-01-28 22:38:28 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-01-28 22:38:28 (GMT)
commitb5a9a3798f43136d5f72391c173880010baef901 (patch)
tree2ad2be640562801c27ced7b66e0dce6775e43bc2 /plugins/pychrysalide/analysis
parent7560e598bf1136b4e7989124fe2b4665508b67b3 (diff)
Taken into account buffer cache may be missing in batch mode.
Diffstat (limited to 'plugins/pychrysalide/analysis')
-rw-r--r--plugins/pychrysalide/analysis/binary.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/pychrysalide/analysis/binary.c b/plugins/pychrysalide/analysis/binary.c
index c173605..f73684b 100644
--- a/plugins/pychrysalide/analysis/binary.c
+++ b/plugins/pychrysalide/analysis/binary.c
@@ -218,9 +218,16 @@ static PyObject *py_loaded_binary_get_disassembled_cache(PyObject *self, void *c
binary = G_LOADED_BINARY(pygobject_get(self));
cache = g_loaded_binary_get_disassembled_cache(binary);
- result = pygobject_new(G_OBJECT(cache));
-
- g_object_unref(G_OBJECT(cache));
+ if (cache != NULL)
+ {
+ result = pygobject_new(G_OBJECT(cache));
+ g_object_unref(G_OBJECT(cache));
+ }
+ else
+ {
+ result = Py_None;
+ Py_INCREF(result);
+ }
return result;