Explorar o código

Fix out of range crashes

Ruben hai 7 meses
pai
achega
3bfc5f13f9
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/PicView.Avalonia/Gallery/GalleryFunctions.cs

+ 1 - 1
src/PicView.Avalonia/Gallery/GalleryFunctions.cs

@@ -260,7 +260,7 @@ public static class GalleryFunctions
             var mainView = UIHelper.GetMainView;
 
             var galleryListBox = mainView.GalleryView.GalleryListBox;
-            if (vm.SelectedGalleryItemIndex < 0)
+            if (vm.SelectedGalleryItemIndex < 0 || vm.SelectedGalleryItemIndex >= galleryListBox.Items.Count)
             {
                 return;
             }