Browse Source

Fixes #852. Avoiding exception if infos is empty.

BDisp 5 years ago
parent
commit
4aa228f200
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Terminal.Gui/Windows/FileDialog.cs

+ 3 - 0
Terminal.Gui/Windows/FileDialog.cs

@@ -349,6 +349,9 @@ namespace Terminal.Gui {
 
 		internal bool ExecuteSelection (bool isPrompt = false)
 		{
+			if (infos.Count == 0) {
+				return false;
+			}
 			var isDir = infos [selected].Item2;
 
 			if (isDir) {