Browse Source

Fix nil tray title crash (#12352)

* Add check for title_ being nil

* remove print stub
Shelley Vohr 7 years ago
parent
commit
9599615b23
1 changed files with 6 additions and 1 deletions
  1. 6 1
      atom/browser/ui/tray_icon_cocoa.mm

+ 6 - 1
atom/browser/ui/tray_icon_cocoa.mm

@@ -230,8 +230,13 @@ const CGFloat kVerticalTitleMargin = 2;
     return;
   }
 
+  // check title_ being nil
+  NSString *title = @"";
+  if (title_)
+    title = title_;
+
   attributedTitle_.reset([[NSMutableAttributedString alloc]
-                             initWithString:title_
+                             initWithString:title
                                  attributes:attributes]);
 
   //NSFontAttributeName:[NSFont menuBarFontOfSize:0],