fix: crash when using TouchBarScrubber arrow button (#30661)

This commit is contained in:
Shelley Vohr
2021-08-24 18:28:57 +02:00
committed by GitHub
parent e43a25724c
commit 32194f0f71
2 changed files with 5 additions and 2 deletions

View File

@@ -735,7 +735,10 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
bool showsArrowButtons = false;
settings.Get("showArrowButtons", &showsArrowButtons);
scrubber.showsArrowButtons = showsArrowButtons;
// The scrubber will crash if the user tries to scroll
// and there are no items.
if ([self numberOfItemsForScrubber:scrubber] > 0)
scrubber.showsArrowButtons = showsArrowButtons;
std::string selectedStyle;
std::string overlayStyle;