Skip to content

Commit 8be6b10

Browse files
usiemsjcfr
authored andcommitted
[Backport] Avoid crash for certain types that have no wrapper because they can't be instantiated
(cherry picked from commit MeVisLab/pythonqt@87362b4)
1 parent b7910cb commit 8be6b10

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PythonQtSlot.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,8 @@ meth_get__doc__(PythonQtSlotFunctionObject * m, void * /*closure*/)
552552
pyReturnType = "float";
553553
} else {
554554
PythonQtClassInfo* returnTypeClassInfo = PythonQt::priv()->getClassInfo(returnType);
555-
if (returnTypeClassInfo) {
555+
// a class wrapper does not necessarily need to exist
556+
if (returnTypeClassInfo && returnTypeClassInfo->pythonQtClassWrapper()) {
556557
PyObject* s = PyObject_GetAttrString(returnTypeClassInfo->pythonQtClassWrapper(), "__module__");
557558
if (s) {
558559
pyReturnType = QByteArray(PyString_AsString(s)) + "." + returnType;

0 commit comments

Comments
 (0)