Browse Source

Fixing an inutile exception.

BDisp 5 years ago
parent
commit
d07b3fc3ec
2 changed files with 2 additions and 2 deletions
  1. 1 1
      Terminal.Gui/Views/ComboBox.cs
  2. 1 1
      Terminal.Gui/Views/ListView.cs

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

@@ -197,7 +197,7 @@ namespace Terminal.Gui {
 		}
 
 		///<inheritdoc/>
-		public override bool OnEnter ()
+		public override bool OnEnter (View view)
 		{
 			if (!search.HasFocus) {
 				this.SetFocus (search);

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

@@ -206,7 +206,7 @@ namespace Terminal.Gui {
 		public int SelectedItem {
 			get => selected;
 			set {
-				if (source == null)
+				if (source == null || source.Count == 0)
 					return;
 				if (selected < 0 || selected >= source.Count)
 					throw new ArgumentException ("value");