Handle case where there's no previous focus
@@ -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;
@@ -382,7 +382,7 @@ namespace Terminal.Gui {
selected = -1;
SetNeedsDisplay ();
SuperView.Remove (openMenu);
- previousFocused.SuperView.SetFocus (previousFocused);
+ previousFocused?.SuperView?.SetFocus (previousFocused);
openMenu = null;