[qt6] Fix writing invalid character to xml when a null qchar is stored in a variant

This commit is contained in:
Nyall Dawson 2022-08-17 11:52:30 +10:00 committed by Julien Cabieces
parent c3b2acc442
commit b7a7e17f33
2 changed files with 1 additions and 6 deletions

View File

@ -7,7 +7,6 @@ test_core_expression
test_core_field
test_core_geometry
test_core_labelingengine
test_core_layertree
test_core_layout
test_core_layouthtml
test_core_layoutlabel
@ -19,18 +18,14 @@ test_core_layouttable
test_core_legendrenderer
test_core_maprendererjob
test_core_maprotation
test_core_meshlayer
test_core_networkaccessmanager
test_core_ogcutils
test_core_pallabeling
test_core_pointpatternfillsymbol
test_core_project
test_core_projectstorage
test_core_rasterlayer
test_core_tiledownloadmanager
test_core_vectortilelayer
test_core_geometry_pointxy
test_analysis_processingalgspt1
test_analysis_processingalgspt2
# block list

View File

@ -169,7 +169,7 @@ QDomElement QgsXmlUtils::writeVariant( const QVariant &value, QDomDocument &doc
case QVariant::Char:
element.setAttribute( QStringLiteral( "type" ), QVariant::typeToName( value.type() ) );
element.setAttribute( QStringLiteral( "value" ), value.isNull() ? QString() : value.toString() );
element.setAttribute( QStringLiteral( "value" ), value.isNull() || value.toChar().isNull() ? QString() : QString( value.toChar() ) );
break;
case QVariant::Color: