From 9599615b234d2dbfaa2226ec544ea65b2d7b2d82 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 19 Mar 2018 10:49:39 -0500 Subject: [PATCH] Fix nil tray title crash (#12352) * Add check for title_ being nil * remove print stub --- atom/browser/ui/tray_icon_cocoa.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/atom/browser/ui/tray_icon_cocoa.mm b/atom/browser/ui/tray_icon_cocoa.mm index a358f676a8c4..91c35034db2b 100644 --- a/atom/browser/ui/tray_icon_cocoa.mm +++ b/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],