Browse Source

Handle case where there's no previous focus

Paul Sanford 7 years ago
parent
commit
167e12759f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Terminal.Gui/Views/Menu.cs

+ 1 - 1
Terminal.Gui/Views/Menu.cs

@@ -382,7 +382,7 @@ namespace Terminal.Gui {
 			selected = -1;
 			SetNeedsDisplay ();
 			SuperView.Remove (openMenu);
-			previousFocused.SuperView.SetFocus (previousFocused);
+			previousFocused?.SuperView.SetFocus (previousFocused);
 			openMenu = null;
 		}