Skip to content

Commit 04a7df7

Browse files
committed
Fix crash when converting Python list with None value to QVariant
1 parent 2483ffb commit 04a7df7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PythonQtConversion.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,9 @@ QVariant PythonQtConv::PyObjToQVariant(PyObject* val, int type)
979979
#endif
980980
) {
981981
// no special type requested
982-
if (PyBytes_Check(val)) {
982+
if (val == nullptr) {
983+
type = QVariant::Invalid;
984+
} else if (PyBytes_Check(val)) {
983985
#ifdef PY3K
984986
// In Python 3, it is a ByteArray
985987
type = QVariant::ByteArray;

0 commit comments

Comments
 (0)