diff --git a/python/PyQt6/core/auto_generated/qgsfeature.sip.in b/python/PyQt6/core/auto_generated/qgsfeature.sip.in index 27cf92c2803..ac48f6ef974 100644 --- a/python/PyQt6/core/auto_generated/qgsfeature.sip.in +++ b/python/PyQt6/core/auto_generated/qgsfeature.sip.in @@ -53,7 +53,8 @@ geometry and a list of field/values attributes. else { const QVariant v = sipCpp->attribute( a0 ); - if ( QgsVariantUtils::isNull( v, true ) ) + // QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip + if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray ) { Py_INCREF( Py_None ); sipRes = Py_None; @@ -115,7 +116,8 @@ geometry and a list of field/values attributes. else { const QVariant v = sipCpp->attribute( fieldIdx ); - if ( QgsVariantUtils::isNull( v, true ) ) + // QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip + if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray ) { Py_INCREF( Py_None ); sipRes = Py_None; diff --git a/python/core/auto_generated/qgsfeature.sip.in b/python/core/auto_generated/qgsfeature.sip.in index 2249ab92ca8..98612c754f7 100644 --- a/python/core/auto_generated/qgsfeature.sip.in +++ b/python/core/auto_generated/qgsfeature.sip.in @@ -57,7 +57,8 @@ geometry and a list of field/values attributes. Py_INCREF( Py_None ); sipRes = Py_None; } - else if ( QgsVariantUtils::isNull( v, true ) ) + // QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip + else if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray ) { PyObject *vartype = sipConvertFromEnum( v.type(), sipType_QVariant_Type ); PyObject *args = PyTuple_Pack( 1, vartype ); @@ -128,7 +129,8 @@ geometry and a list of field/values attributes. Py_INCREF( Py_None ); sipRes = Py_None; } - else if ( QgsVariantUtils::isNull( v, true ) ) + // QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip + else if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray ) { PyObject *vartype = sipConvertFromEnum( v.type(), sipType_QVariant_Type ); PyObject *args = PyTuple_Pack( 1, vartype ); diff --git a/src/core/qgsfeature.h b/src/core/qgsfeature.h index 3396562bf72..8b538705df9 100644 --- a/src/core/qgsfeature.h +++ b/src/core/qgsfeature.h @@ -96,7 +96,8 @@ class CORE_EXPORT QgsFeature Py_INCREF( Py_None ); sipRes = Py_None; } - else if ( QgsVariantUtils::isNull( v, true ) ) + // QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip + else if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray ) { PyObject *vartype = sipConvertFromEnum( v.type(), sipType_QVariant_Type ); PyObject *args = PyTuple_Pack( 1, vartype ); @@ -167,7 +168,8 @@ class CORE_EXPORT QgsFeature Py_INCREF( Py_None ); sipRes = Py_None; } - else if ( QgsVariantUtils::isNull( v, true ) ) + // QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip + else if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray ) { PyObject *vartype = sipConvertFromEnum( v.type(), sipType_QVariant_Type ); PyObject *args = PyTuple_Pack( 1, vartype ); @@ -236,7 +238,8 @@ class CORE_EXPORT QgsFeature else { const QVariant v = sipCpp->attribute( a0 ); - if ( QgsVariantUtils::isNull( v, true ) ) + // QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip + if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray ) { Py_INCREF( Py_None ); sipRes = Py_None; @@ -298,7 +301,8 @@ class CORE_EXPORT QgsFeature else { const QVariant v = sipCpp->attribute( fieldIdx ); - if ( QgsVariantUtils::isNull( v, true ) ) + // QByteArray null handling is "special"! See null_from_qvariant_converter in conversions.sip + if ( QgsVariantUtils::isNull( v, true ) && v.userType() != QMetaType::Type::QByteArray ) { Py_INCREF( Py_None ); sipRes = Py_None;