Skip to content

Commit

Permalink
Merge pull request #7768 from nyalldawson/assert
Browse files Browse the repository at this point in the history
Throw an assert when using an unsupported variant type with QgsXmlUtils::writeVariant
  • Loading branch information
m-kuhn committed Sep 3, 2018
2 parents 74e6e15 + 309992b commit 3c58d09
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/core/qgsxmlutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ QDomElement QgsXmlUtils::writeVariant( const QVariant &value, QDomDocument &doc
}

default:
element.setAttribute( QStringLiteral( "type" ), QStringLiteral( "Unknown" ) );
element.setAttribute( QStringLiteral( "value" ), value.toString() );
Q_ASSERT_X( false, "QgsXmlUtils::writeVariant", "unsupported variant type" );
break;
}

Expand Down

0 comments on commit 3c58d09

Please sign in to comment.