Browse Source

Fixes #852. Avoiding exception if infos is empty.

BDisp 5 năm trước cách đây
mục cha
commit
4aa228f200
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  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) {