diff options
-rw-r--r-- | sources/shiboken6/libshiboken/sbkfeature_base.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sources/shiboken6/libshiboken/sbkfeature_base.cpp b/sources/shiboken6/libshiboken/sbkfeature_base.cpp index 1242cbda4..662e9276d 100644 --- a/sources/shiboken6/libshiboken/sbkfeature_base.cpp +++ b/sources/shiboken6/libshiboken/sbkfeature_base.cpp @@ -185,6 +185,9 @@ static PyObject *replaceNoArgWithZero(PyObject *callable) static PyObject *lookupUnqualifiedOrOldEnum(PyTypeObject *type, PyObject *name) { + // MRO has been observed to be 0 in case of errors with QML decorators + if (type == nullptr || type->tp_mro == nullptr) + return nullptr; static PyTypeObject *const EnumMeta = getPyEnumMeta(); static PyObject *const _member_map_ = String::createStaticString("_member_map_"); // This is similar to `find_name_in_mro`, but instead of looking directly into |