Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Do not return invalid layers from findLayers()
- Loading branch information
Showing
with
1 addition
and
1 deletion.
-
+1
−1
src/core/layertree/qgslayertreegroup.cpp
|
@@ -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(); |
|
|