Skip to content

Commit d315fdf

Browse files
committedMar 2, 2017
canvas: don't try to connect to null layers
1 parent bceb8ff commit d315fdf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎src/gui/qgsmapcanvas.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ void QgsMapCanvas::setLayers( const QList<QgsMapLayer*>& layers )
310310

311311
Q_FOREACH ( QgsMapLayer* layer, layers )
312312
{
313+
if ( !layer )
314+
continue;
313315
connect( layer, &QgsMapLayer::repaintRequested, this, &QgsMapCanvas::layerRepaintRequested );
314316
connect( layer, &QgsMapLayer::crsChanged, this, &QgsMapCanvas::layerCrsChange );
315317
connect( layer, &QgsMapLayer::autoRefreshIntervalChanged, this, &QgsMapCanvas::updateAutoRefreshTimer );

0 commit comments

Comments
 (0)
Please sign in to comment.