Skip to content

Commit 87362b4

Browse files
committed
Avoid crash for certain types that have no wrapper because they can't be instantiated
1 parent 3f8a1d1 commit 87362b4

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
@@ -554,7 +554,8 @@ meth_get__doc__(PythonQtSlotFunctionObject * m, void * /*closure*/)
554554
pyReturnType = "float";
555555
} else {
556556
PythonQtClassInfo* returnTypeClassInfo = PythonQt::priv()->getClassInfo(returnType);
557-
if (returnTypeClassInfo) {
557+
// a class wrapper does not necessarily need to exist
558+
if (returnTypeClassInfo && returnTypeClassInfo->pythonQtClassWrapper()) {
558559
PyObject* s = PyObject_GetAttrString(returnTypeClassInfo->pythonQtClassWrapper(), "__module__");
559560
if (s) {
560561
pyReturnType = QByteArray(PyString_AsString(s)) + "." + returnType;

0 commit comments

Comments
 (0)