aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/basewrapper.cpp
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2023-05-25 11:23:00 +0300
committerSimo Fält <simo.falt@qt.io>2023-05-25 11:23:00 +0300
commite31990ada911989dbcef3d4833f77dd054030e2c (patch)
treee08ea7c0808e1468b3c8bbd83fb189a81d8ebeb0 /sources/shiboken2/libshiboken/basewrapper.cpp
parent40fdea15e6545292212ea6c4acc78c3b2975cbd8 (diff)
parentd135bcccdb609d312993e26b466a853b8d1b3f43 (diff)
Merge tag 'v5.15.7-lts' into tqtc/lts-5.15-opensourcev5.15.7-lts-lgpl
Qt For Python Release 5.15.7 Change-Id: I49808098e3ba42be4be438cb3536fc25672c7127
Diffstat (limited to 'sources/shiboken2/libshiboken/basewrapper.cpp')
-rw-r--r--sources/shiboken2/libshiboken/basewrapper.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/sources/shiboken2/libshiboken/basewrapper.cpp b/sources/shiboken2/libshiboken/basewrapper.cpp
index 113128f5a..7ac7fada2 100644
--- a/sources/shiboken2/libshiboken/basewrapper.cpp
+++ b/sources/shiboken2/libshiboken/basewrapper.cpp
@@ -560,7 +560,8 @@ PyObject *MakeQAppWrapper(PyTypeObject *type)
// protecting from multiple application instances
if (!(type == nullptr || qApp_last == Py_None)) {
- const char *res_name = PepType_GetNameStr(Py_TYPE(qApp_last));
+ const char *res_name = qApp_last != nullptr
+ ? PepType_GetNameStr(Py_TYPE(qApp_last)) : "<Unknown>";
const char *type_name = PepType_GetNameStr(type);
PyErr_Format(PyExc_RuntimeError, "Please destroy the %s singleton before"
" creating a new %s instance.", res_name, type_name);