Browse Source

Merge remote-tracking branch 'origin/pre-deploy-fixes' into pre-deploy-fixes

flabbet 4 years ago
parent
commit
0a7196ccfb
1 changed files with 5 additions and 1 deletions
  1. 5 1
      PixiEditor/ViewModels/SubViewModels/Main/FileViewModel.cs

+ 5 - 1
PixiEditor/ViewModels/SubViewModels/Main/FileViewModel.cs

@@ -154,7 +154,11 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
                 if (Importer.IsSupportedFile(dialog.FileName))
                 if (Importer.IsSupportedFile(dialog.FileName))
                 {
                 {
                     Open(dialog.FileName);
                     Open(dialog.FileName);
-                    Owner.BitmapManager.ActiveDocument = Owner.BitmapManager.Documents.Last();
+
+                    if (Owner.BitmapManager.Documents.Count > 0)
+                    {
+                        Owner.BitmapManager.ActiveDocument = Owner.BitmapManager.Documents.Last();
+                    }
                 }
                 }
             }
             }
         }
         }