Browse Source

Prevent crash when opening debug location

CPKreuz 3 years ago
parent
commit
a935212570
1 changed files with 6 additions and 0 deletions
  1. 6 0
      PixiEditor/ViewModels/SubViewModels/Main/DebugViewModel.cs

+ 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);
         }