Browse Source

Forgot to check if the source.Count > 0.

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

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

@@ -532,7 +532,7 @@ namespace Terminal.Gui {
 		///<inheritdoc/>
 		///<inheritdoc/>
 		public override bool OnEnter (View view)
 		public override bool OnEnter (View view)
 		{
 		{
-			if (lastSelectedItem == -1) {
+			if (source.Count > 0 && lastSelectedItem == -1) {
 				OnSelectedChanged ();
 				OnSelectedChanged ();
 				return true;
 				return true;
 			}
 			}