浏览代码

Fixes #852. Avoiding exception if infos is empty.

BDisp 5 年之前
父节点
当前提交
4aa228f200
共有 1 个文件被更改,包括 3 次插入0 次删除
  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) {