diff --git a/source/blender/python/intern/bpy_rna_text.c b/source/blender/python/intern/bpy_rna_text.c index 7ccc70cc7fa..9653ecbe1e3 100644 --- a/source/blender/python/intern/bpy_rna_text.c +++ b/source/blender/python/intern/bpy_rna_text.c @@ -75,7 +75,7 @@ static PyObject *bpy_rna_region_as_string(PyObject *self, PyObject *args, PyObje return NULL; } - if (PyDict_GET_SIZE(kwds) > 0) { + if (kwds && PyDict_GET_SIZE(kwds) > 0) { txt_sel_set(text, region.curl, region.curc, region.sell, region.selc); } @@ -140,7 +140,7 @@ static PyObject *bpy_rna_region_from_string(PyObject *self, PyObject *args, PyOb return NULL; } - if (PyDict_GET_SIZE(kwds) > 0) { + if (kwds && PyDict_GET_SIZE(kwds) > 0) { txt_sel_set(text, region.curl, region.curc, region.sell, region.selc); }