Bug 1566086 - Add error message if touchBarAction crash is encountered. r=spohl a=RyanVM
authorharry <htwyford@mozilla.com>
Tue, 16 Jul 2019 15:13:22 +0000
changeset 544680 80b47b3c406e9e8bffb31d45c9e11bfb1547dfc3
parent 544679 b0ad1f66125c316df95b46bede5856a59ea0d75c
child 544681 fea8c86cd0d3c087575f393fa2b793eca3976126
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersspohl, RyanVM
bugs1566086
milestone69.0
Bug 1566086 - Add error message if touchBarAction crash is encountered. r=spohl a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D38116
widget/cocoa/nsTouchBar.mm
--- a/widget/cocoa/nsTouchBar.mm
+++ b/widget/cocoa/nsTouchBar.mm
@@ -197,16 +197,21 @@ static char sIdentifierAssociationKey;
   }
 
   TouchBarInput* input = self.mappedLayoutItems[identifier];
   if (!input) {
     return;
   }
 
   nsCOMPtr<nsITouchBarInputCallback> callback = [input callback];
+  if (!callback) {
+    NSLog(@"Touch Bar action attempted with no valid callback! Identifier: %@",
+          [input nativeIdentifier]);
+    return;
+  }
   callback->OnCommand();
 }
 
 - (void)releaseJSObjects {
   mTouchBarHelper = nil;
 
   for (NSTouchBarItemIdentifier identifier in self.mappedLayoutItems) {
     TouchBarInput* input = self.mappedLayoutItems[identifier];