Skip to content

Fix nil tray title crash#12352

Merged
codebytere merged 2 commits into
masterfrom
fix-nil-tray-title-crash
Mar 19, 2018
Merged

Fix nil tray title crash#12352
codebytere merged 2 commits into
masterfrom
fix-nil-tray-title-crash

Conversation

@codebytere

Copy link
Copy Markdown
Member

Fixes #12343.

Previously, if you set the title of a Tray to an empty string, setTitle would crash because it would attempt to call

attributedTitle_.reset([[NSMutableAttributedString alloc]
                             initWithString:title
                                 attributes:attributes]);

with a nil title, likely resultant of faulty conversion.

This PR adds a check for the title being nil, and if it is, resets it to an empty string before calling the above initWithTitle method.

/cc @MarshallOfSound

@codebytere codebytere requested a review from a team March 19, 2018 14:55
@codebytere codebytere force-pushed the fix-nil-tray-title-crash branch from a3ad9c3 to 752c1a7 Compare March 19, 2018 15:09

@MarshallOfSound MarshallOfSound left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, seems legit. I'd love to know if this has been here forever, or a recent chromium converter change broke it. But this patch will work for now 👍

@codebytere

Copy link
Copy Markdown
Member Author

MacOS failed on known flake: 328 inAppPurchase module purchaseProduct() fails when buying invalid product

@codebytere codebytere merged commit 9599615 into master Mar 19, 2018
@codebytere

Copy link
Copy Markdown
Member Author

/trop run backport

@trop

trop Bot commented Mar 19, 2018

Copy link
Copy Markdown
Contributor

The backport process for this PR has been manually initiated, here we go! :D

@trop

trop Bot commented Mar 19, 2018

Copy link
Copy Markdown
Contributor

An error occurred while attempting to backport this PR to "1-8-x", you will need to perform this backport manually

@trop

trop Bot commented Mar 19, 2018

Copy link
Copy Markdown
Contributor

We have automatically backported this PR to "2-0-x", please check out #12356

@trop trop Bot added merged/2-0-x and removed target/2-0-x labels Mar 19, 2018
@codebytere codebytere deleted the fix-nil-tray-title-crash branch March 29, 2018 16:38
sethlu pushed a commit to sethlu/electron that referenced this pull request May 3, 2018
* Add check for title_ being nil

* remove print stub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants