aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-10-25 14:39:43 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-10-26 14:24:13 +0000
commit02dfdfd61b99eb5780d1604c963f7e95d5b086ee (patch)
tree29410e9a441398ae2f416086b48702b92c85c6e9
parent6abde77c3df60ccac25089660df5797de7f6e68c (diff)
Fix crashes related to broken QML decorators
Pick-to: 6.5 Task-number: PYSIDE-2432 Change-Id: I0108c944ce07e28f1af93a3f2adf51ebd76e92c4 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 3b086f648a2387989ff21f90660dca1404f7f734) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--sources/shiboken6/libshiboken/sbkfeature_base.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/sources/shiboken6/libshiboken/sbkfeature_base.cpp b/sources/shiboken6/libshiboken/sbkfeature_base.cpp
index acf527e49..41e2aaa5b 100644
--- a/sources/shiboken6/libshiboken/sbkfeature_base.cpp
+++ b/sources/shiboken6/libshiboken/sbkfeature_base.cpp
@@ -196,6 +196,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