diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-10-25 14:39:43 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-10-26 21:32:28 +0000 |
commit | 42e85122181662a8a5c48b534efd642088960b26 (patch) | |
tree | e67480a2effd34533f7089a7476aab3b82c20736 | |
parent | ba73b2f7958b317254a570dda31c364fac35e4b1 (diff) |
Fix crashes related to broken QML decorators
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>
(cherry picked from commit 02dfdfd61b99eb5780d1604c963f7e95d5b086ee)
-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 |