Skip to content

Commit 04edffb

Browse files
committed
fix(#219): slideshow av buttons causing crash
1 parent 637334c commit 04edffb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Shared/Views/AccessoryViews/SwiftUI/SlideShowView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ struct SlideShowView: View {
8787
HStack(alignment: .center) {
8888
if selection != 0 {
8989
Button {
90+
guard selection > 0 else { return }
9091
selection -= 1
9192
invalidateTimer()
9293
} label: {
@@ -105,6 +106,7 @@ struct SlideShowView: View {
105106
Spacer()
106107
if selection != images.count-1 {
107108
Button {
109+
guard selection < images.count-1 else { return }
108110
selection += 1
109111
invalidateTimer()
110112
} label: {

0 commit comments

Comments
 (0)