From 5fe3ac60faaa0400858c863c615d4d3183eaee6c Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 1 Mar 2017 15:29:34 -0800 Subject: [PATCH] Check that atom_touch_bar_ is set --- atom/browser/native_window_mac.mm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index b59360ec3725..12315ae255de 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -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;