Guard against missing popover identifier
This commit is contained in:
parent
9c73c991d7
commit
6a22c6645e
1 changed files with 17 additions and 8 deletions
|
@ -165,18 +165,27 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
||||||
std::string item_type;
|
std::string item_type;
|
||||||
settings.Get("type", &item_type);
|
settings.Get("type", &item_type);
|
||||||
|
|
||||||
NSTouchBarItemIdentifier identifier = [self identifierFromID:item_id
|
auto identifier = [self identifierFromID:item_id type:item_type];
|
||||||
type:item_type];
|
|
||||||
if (!identifier) return;
|
if (!identifier) return;
|
||||||
|
|
||||||
std::vector<std::string> popover_ids;
|
std::vector<std::string> popover_ids;
|
||||||
if (settings.Get("_popover", &popover_ids)) {
|
settings.Get("_popover", &popover_ids);
|
||||||
for (auto& popover_id : popover_ids) {
|
for (auto& popover_id : popover_ids) {
|
||||||
NSPopoverTouchBarItem* popoverItem = [touchBar itemForIdentifier:[self identifierFromID:popover_id type:"popover"]];
|
auto popoverIdentifier = [self identifierFromID:popover_id type:"popover"];
|
||||||
[self refreshTouchBarItem:popoverItem.popoverTouchBar id:identifier withType:item_type withSettings:settings];
|
if (!popoverIdentifier) continue;
|
||||||
}
|
|
||||||
|
NSPopoverTouchBarItem* popoverItem =
|
||||||
|
[touchBar itemForIdentifier:popoverIdentifier];
|
||||||
|
[self refreshTouchBarItem:popoverItem.popoverTouchBar
|
||||||
|
id:identifier
|
||||||
|
withType:item_type
|
||||||
|
withSettings:settings];
|
||||||
}
|
}
|
||||||
[self refreshTouchBarItem:touchBar id:identifier withType:item_type withSettings:settings];
|
|
||||||
|
[self refreshTouchBarItem:touchBar
|
||||||
|
id:identifier
|
||||||
|
withType:item_type
|
||||||
|
withSettings:settings];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)buttonAction:(id)sender {
|
- (void)buttonAction:(id)sender {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue