Browse Source

Check that atom_touch_bar_ is set

Kevin Sawicki 8 years ago
parent
commit
5fe3ac60fa
1 changed files with 7 additions and 3 deletions
  1. 7 3
      atom/browser/native_window_mac.mm

+ 7 - 3
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;