mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
QgsVectorLayer::writeSymbology(): fix crash when called with invalid data provider
This commit is contained in:
parent
a70d42802f
commit
9ae156970a
@ -1947,7 +1947,14 @@ bool QgsVectorLayer::writeSymbology( QDomNode& node, QDomDocument& doc, QString&
|
||||
mConditionalStyles->writeXml( node, doc );
|
||||
|
||||
// save expression fields
|
||||
mExpressionFieldBuffer->writeXml( node, doc );
|
||||
if ( !mExpressionFieldBuffer )
|
||||
{
|
||||
// can happen when saving style on a invalid layer
|
||||
QgsExpressionFieldBuffer dummy;
|
||||
dummy.writeXml( node, doc );
|
||||
}
|
||||
else
|
||||
mExpressionFieldBuffer->writeXml( node, doc );
|
||||
|
||||
// save readonly state
|
||||
node.toElement().setAttribute( QStringLiteral( "readOnly" ), mReadOnly );
|
||||
|
Loading…
x
Reference in New Issue
Block a user