Skip to content

Commit 798f0f7

Browse files
committedMar 14, 2017
Avoid Qt warning due to null action
1 parent 2654c72 commit 798f0f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/app/qgsapplayertreeviewmenuprovider.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
129129
if ( !layer->isInScaleRange( mCanvas->scale() ) )
130130
menu->addAction( tr( "Zoom to &Visible Scale" ), QgisApp::instance(), SLOT( zoomToLayerScale() ) );
131131

132-
menu->addAction( actions->actionCheckAndAllParents( menu ) );
132+
QAction *checkAll = actions->actionCheckAndAllParents( menu );
133+
if ( checkAll )
134+
menu->addAction( checkAll );
133135

134136
// set layer crs
135137
menu->addAction( QgsApplication::getThemeIcon( QStringLiteral( "/mActionSetCRS.png" ) ), tr( "Set Layer CRS" ), QgisApp::instance(), SLOT( setLayerCrs() ) );

0 commit comments

Comments
 (0)
Please sign in to comment.