Skip to content

Commit 60c1e51

Browse files
author
Sandro Santilli
committed
Survive when setLayerExpanded is called with a layer unknown by legend
1 parent c87f9c5 commit 60c1e51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app/legend/qgsapplegendinterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void QgsAppLegendInterface::setLayerVisible( QgsMapLayer * ml, bool visible )
116116
void QgsAppLegendInterface::setLayerExpanded( QgsMapLayer * ml, bool expand )
117117
{
118118
QgsLegendLayer * item = mLegend->findLegendLayer( ml );
119-
item->setExpanded( expand );
119+
if ( item ) item->setExpanded( expand );
120120
}
121121

122122
QStringList QgsAppLegendInterface::groups()

0 commit comments

Comments
 (0)