Skip to content

Commit 3c58d09

Browse files
authored
Merge pull request #7768 from nyalldawson/assert
Throw an assert when using an unsupported variant type with QgsXmlUtils::writeVariant
2 parents 74e6e15 + 309992b commit 3c58d09

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/core/qgsxmlutils.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ QDomElement QgsXmlUtils::writeVariant( const QVariant &value, QDomDocument &doc
166166
}
167167

168168
default:
169-
element.setAttribute( QStringLiteral( "type" ), QStringLiteral( "Unknown" ) );
170-
element.setAttribute( QStringLiteral( "value" ), value.toString() );
169+
Q_ASSERT_X( false, "QgsXmlUtils::writeVariant", "unsupported variant type" );
171170
break;
172171
}
173172

0 commit comments

Comments
 (0)