Skip to content

Commit

Permalink
Don't crash if embedded group cannot be loaded (Fix #7872)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jun 12, 2013
1 parent b3d184d commit 8024df7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -1845,11 +1845,14 @@ bool QgsLegend::readXML( QgsLegendGroup *parent, const QDomNode &node )
if ( childelem.attribute( "embedded" ) == "1" )
{
theGroup = addEmbeddedGroup( name, QgsProject::instance()->readPath( childelem.attribute( "project" ) ) );
if ( childelem.hasAttribute( "drawingOrder" ) )
if ( theGroup )
{
theGroup->setDrawingOrder( childelem.attribute( "drawingOrder" ).toInt() );
if ( childelem.hasAttribute( "drawingOrder" ) )
{
theGroup->setDrawingOrder( childelem.attribute( "drawingOrder" ).toInt() );
}
updateGroupCheckStates( theGroup );
}
updateGroupCheckStates( theGroup );
}
else
{
Expand Down

0 comments on commit 8024df7

Please sign in to comment.