Skip to content

Commit

Permalink
Merge pull request #7373 from AvaloniaUI/fix-nre-menu-close
Browse files Browse the repository at this point in the history
Fix NRE on window close with opened menu
  • Loading branch information
Takoooooo authored Jan 17, 2022
2 parents 1468b35 + ba85c01 commit 946fbd4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public virtual void Detach(IMenu menu)
root.Deactivated -= WindowDeactivated;
}

if (_root is TopLevel tl)
if (_root is TopLevel tl && tl.PlatformImpl != null)
tl.PlatformImpl.LostFocus -= TopLevelLostPlatformFocus;

_inputManagerSubscription?.Dispose();
Expand Down

0 comments on commit 946fbd4

Please sign in to comment.