Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cb6d3b6

Browse files
vcloarecnyalldawson
authored andcommittedMar 17, 2023
fix void context menu of map canvas
1 parent da41985 commit cb6d3b6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎src/gui/qgsmapcanvas.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,6 +1208,9 @@ void QgsMapCanvas::showContextMenu( QgsMapMouseEvent *event )
12081208
if ( !mapTool()->populateContextMenuWithEvent( &menu, event ) )
12091209
mMapTool->populateContextMenu( &menu );
12101210

1211+
if ( menu.isEmpty() ) // menu can be empty after populateContextMenu()
1212+
return;
1213+
12111214
emit contextMenuAboutToShow( &menu, event );
12121215

12131216
menu.exec( event->globalPos() );

0 commit comments

Comments
 (0)
Please sign in to comment.