Check that atom_touch_bar_ is set

This commit is contained in:
Kevin Sawicki 2017-03-01 15:29:34 -08:00
parent 708ed9d1cd
commit 5fe3ac60fa

View file

@ -376,16 +376,20 @@ bool ScopedDisableResize::disable_resize_ = false;
}
- (void)refreshTouchBarItem:(const std::string&)item_id {
[atom_touch_bar_ refreshTouchBarItem:item_id];
if (atom_touch_bar_)
[atom_touch_bar_ refreshTouchBarItem:item_id];
}
- (NSTouchBar*)makeTouchBar {
return [atom_touch_bar_ makeTouchBar];
if (atom_touch_bar_)
return [atom_touch_bar_ makeTouchBar];
else
return nil;
}
- (nullable NSTouchBarItem*)touchBar:(NSTouchBar*)touchBar
makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier {
if (touchBar)
if (touchBar && atom_touch_bar_)
return [atom_touch_bar_ makeItemForIdentifier:identifier];
else
return nil;