Skip to content

Commit 95a575e

Browse files
sboxbottrende2001
andauthored
Fix "QMenu was null when calling clear" error (#3516)
Co-authored-by: trende2001 <68961063+trende2001@users.noreply.github.com>
1 parent abfa79f commit 95a575e

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

engine/Sandbox.Tools/Qt/Menu.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,11 +386,14 @@ public void OpenAtCursor( bool modal = false )
386386

387387
public void Clear()
388388
{
389+
if ( _menu.IsNull )
390+
return;
391+
389392
_menu.clear();
390393

391-
Menus.Clear();
392-
Options.Clear();
393-
_widgets.Clear();
394+
Menus?.Clear();
395+
Options?.Clear();
396+
_widgets?.Clear();
394397
}
395398

396399
Option lastActive;

0 commit comments

Comments
 (0)