Pārlūkot izejas kodu

Fixed sequence not found exception

Krzysztof Krysiński 3 nedēļas atpakaļ
vecāks
revīzija
7da9c21e71
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  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 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));
     }