浏览代码

Fixed sequence not found exception

Krzysztof Krysiński 3 周之前
父节点
当前提交
7da9c21e71
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/PixiEditor/Helpers/SupportedFilesHelper.cs

+ 6 - 0
src/PixiEditor/Helpers/SupportedFilesHelper.cs

@@ -86,6 +86,12 @@ internal class SupportedFilesHelper
         string? localPath = file.TryGetLocalPath();
         string? localPath = file.TryGetLocalPath();
 
 
         string extension = Path.GetExtension(localPath ?? file.Name);
         string extension = Path.GetExtension(localPath ?? file.Name);
+
+        if (string.IsNullOrEmpty(extension))
+        {
+            return allSupportedExtensions.First(i => i.CanSave);
+        }
+
         return allSupportedExtensions.Single(i => i.CanSave && i.Extensions.Contains(extension, StringComparer.OrdinalIgnoreCase));
         return allSupportedExtensions.Single(i => i.CanSave && i.Extensions.Contains(extension, StringComparer.OrdinalIgnoreCase));
     }
     }