Merge pull request #97 from pmsanford/master

Handle case where there's no previous focus
This commit is contained in:
Miguel de Icaza
2018-05-25 16:05:32 -07:00
committed by GitHub
2 changed files with 3 additions and 1 deletions

View File

@@ -180,6 +180,8 @@ namespace Terminal.Gui {
if (source == null)
throw new ArgumentNullException (nameof (source));
Source = MakeWrapper (source);
((ListWrapper) Source).Container = this;
((ListWrapper) Source).Driver = Driver;
}
bool allowsMarking;

View File

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