Prechádzať zdrojové kódy

Prevent crash when opening debug location

CPKreuz 3 rokov pred
rodič
commit
a935212570

+ 6 - 0
PixiEditor/ViewModels/SubViewModels/Main/DebugViewModel.cs

@@ -36,6 +36,12 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
         [Command.Debug("PixiEditor.Debug.OpenCrashReportsDirectory", "%LocalAppData%/PixiEditor/crash_logs", "Open Crash Reports Directory", "Open Crash Reports Directory")]
         public static void OpenFolder(string path)
         {
+            if (!Directory.Exists(path))
+            {
+                NoticeDialog.Show($"{path} does not exist.", "Location does not exist");
+                return;
+            }
+        
             ProcessHelpers.ShellExecuteEV(path);
         }