summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/gui
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-08-16 19:57:36 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-08-16 19:57:36 (GMT)
commitf67cbb09ba8421b70a9a65d4192d164279be71b8 (patch)
treeab91a53d5adabed5c81fdf756de468c5d5b014f3 /plugins/pychrysalide/gui
parent49af9c6449eb48d0ab1fb0893ad59b415f41d3cd (diff)
Strongified the Python bindings when running without GUI.
Diffstat (limited to 'plugins/pychrysalide/gui')
-rw-r--r--plugins/pychrysalide/gui/core/global.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/pychrysalide/gui/core/global.c b/plugins/pychrysalide/gui/core/global.c
index a3b62ee..80c2c60 100644
--- a/plugins/pychrysalide/gui/core/global.c
+++ b/plugins/pychrysalide/gui/core/global.c
@@ -76,10 +76,17 @@ static PyObject *py_global_get_editor_builder(PyObject *self, PyObject *args)
)
builder = get_editor_builder();
- assert(builder != NULL);
- result = pygobject_new(G_OBJECT(builder));
- g_object_unref(G_OBJECT(builder));
+ if (builder != NULL)
+ {
+ result = pygobject_new(G_OBJECT(builder));
+ g_object_unref(G_OBJECT(builder));
+ }
+ else
+ {
+ result = Py_None;
+ Py_INCREF(result);
+ }
return result;