Skip to content
Permalink
Browse files

Merge pull request #7211 from elpaso/bugfix-19145-legend-crash

[bugfix] Do not crash when removing a layout legend item
  • Loading branch information
elpaso committed Jun 9, 2018
2 parents f4ecbbf + 137bc4d commit 2872665365cff7b9e05405aa24fdaf6dcb2ba227
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/core/layertree/qgslayertree.cpp
@@ -138,6 +138,10 @@ void QgsLayerTree::writeXml( QDomElement &parentElement, const QgsReadWriteConte

Q_FOREACH ( QgsMapLayer *layer, mCustomLayerOrder )
{
// Safety belt, see https://issues.qgis.org/issues/19145
// Crash when deleting an item from the layout legend
if ( ! layer )
continue;
QDomElement layerElem = doc.createElement( QStringLiteral( "item" ) );
layerElem.appendChild( doc.createTextNode( layer->id() ) );
customOrderElem.appendChild( layerElem );

0 comments on commit 2872665

Please sign in to comment.
You can’t perform that action at this time.