Skip to content

Commit 59cc67e

Browse files
committed
Fix nullptr crash in error message
1 parent 5f59734 commit 59cc67e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/PythonQtConversion.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,9 @@ QString PythonQtConv::PyObjGetRepresentation(PyObject* val)
823823
QString PythonQtConv::PyObjGetString(PyObject* val, bool strict, bool& ok) {
824824
QString r;
825825
ok = true;
826+
if (val == nullptr) {
827+
r = "None";
828+
} else
826829
#ifndef PY3K
827830
// in Python 3, we don't want to convert to QString, since we don't know anything about the encoding
828831
// in Python 2, we assume the default for str is latin-1

0 commit comments

Comments
 (0)