summaryrefslogtreecommitdiffstats
path: root/macosx/HBPreviewController.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2015-09-29 19:23:23 +0200
committerDamiano Galassi <[email protected]>2015-09-29 19:23:23 +0200
commit3a0453a7b705b9a15941eafb2997bbd18b00cfc7 (patch)
treec3f4d26275a19d092963a71af1a9b5801f63497b /macosx/HBPreviewController.m
parent291243c3fcd34282a700b059995c27a993b12e71 (diff)
MacGui: read the actual preview count so we don't try to load a non existing image
Diffstat (limited to 'macosx/HBPreviewController.m')
-rw-r--r--macosx/HBPreviewController.m5
1 files changed, 5 insertions, 0 deletions
diff --git a/macosx/HBPreviewController.m b/macosx/HBPreviewController.m
index 7449c342d..9be3bae5b 100644
--- a/macosx/HBPreviewController.m
+++ b/macosx/HBPreviewController.m
@@ -231,6 +231,11 @@ typedef enum ViewMode : NSUInteger {
[fPictureSlider setMaxValue: generator.imagesCount - 1.0];
[fPictureSlider setNumberOfTickMarks: generator.imagesCount];
+ if (self.pictureIndex > generator.imagesCount)
+ {
+ self.pictureIndex = generator.imagesCount - 1;
+ }
+
[self switchViewToMode:ViewModePicturePreview];
[self displayPreview];
}