From f67cbb09ba8421b70a9a65d4192d164279be71b8 Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Sun, 16 Aug 2020 21:57:36 +0200
Subject: Strongified the Python bindings when running without GUI.

---
 plugins/pychrysalide/gui/core/global.c | 13 ++++++++++---
 1 file 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;
 
-- 
cgit v0.11.2-87-g4458