Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Do not return invalid layers from findLayers()
  • Loading branch information
elpaso committed Jun 7, 2018
1 parent ec909b0 commit 2f2221a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/layertree/qgslayertreegroup.cpp
Expand Up @@ -221,7 +221,7 @@ QList<QgsLayerTreeLayer *> QgsLayerTreeGroup::findLayers() const
QList<QgsLayerTreeLayer *> list;
Q_FOREACH ( QgsLayerTreeNode *child, mChildren )
{
if ( QgsLayerTree::isLayer( child ) )
if ( QgsLayerTree::isLayer( child ) && QgsLayerTree::toLayer( child )->layer( ) )
list << QgsLayerTree::toLayer( child );
else if ( QgsLayerTree::isGroup( child ) )
list << QgsLayerTree::toGroup( child )->findLayers();
Expand Down

0 comments on commit 2f2221a

Please sign in to comment.