Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: crash caused by app.getLocaleCountryCode() #32256

Merged
merged 1 commit into from Jan 3, 2022

Conversation

RaisinTen
Copy link
Member

Description of Change

CFLocaleGetValue() returned null and crashed the process when
app.getLocaleCountryCode() was run on a CircleCI metal resource class
macOS instance with Xcode 12.5.1. This change fixes that logic and adds
further checks to make the code future-proof.

Here too people are complaining that the returned country code migth be
null: https://stackoverflow.com/questions/15202454/nslocalecountrycode-returns-nil

Signed-off-by: Darshan Sen darshan.sen@postman.com

Checklist

Release Notes

Notes: Fixed a crash caused by app.getLocaleCountryCode().

CFLocaleGetValue() returned null and crashed the process when
app.getLocaleCountryCode() was run on a CircleCI metal resource class
macOS instance with Xcode 12.5.1. This change fixes that logic and adds
further checks to make the code future-proof.

Here too people are complaining that the returned country code migth be
null: https://stackoverflow.com/questions/15202454/nslocalecountrycode-returns-nil

Signed-off-by: Darshan Sen <darshan.sen@postman.com>
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Dec 20, 2021
@VerteDinde VerteDinde added the semver/patch backwards-compatible bug fixes label Dec 20, 2021
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Dec 21, 2021
Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

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

Thanks!

@VerteDinde VerteDinde merged commit 4600d7e into electron:main Jan 3, 2022
@release-clerk
Copy link

release-clerk bot commented Jan 3, 2022

Release Notes Persisted

Fixed a crash caused by app.getLocaleCountryCode().

@trop
Copy link
Contributor

trop bot commented Jan 3, 2022

I have automatically backported this PR to "16-x-y", please check out #32321

@trop
Copy link
Contributor

trop bot commented Jan 3, 2022

I have automatically backported this PR to "17-x-y", please check out #32322

@miniak
Copy link
Contributor

miniak commented Jan 4, 2022

/trop run backport-to 15-x-y

@trop
Copy link
Contributor

trop bot commented Jan 4, 2022

The backport process for this PR has been manually initiated - sending your PR to 15-x-y!

@trop
Copy link
Contributor

trop bot commented Jan 4, 2022

I have automatically backported this PR to "15-x-y", please check out #32332

@trop trop bot added the in-flight/15-x-y label Jan 4, 2022
@RaisinTen RaisinTen deleted the fix/app.getLocaleCountryCode branch January 4, 2022 04:57
t57ser pushed a commit to t57ser/electron that referenced this pull request Jan 25, 2022
CFLocaleGetValue() returned null and crashed the process when
app.getLocaleCountryCode() was run on a CircleCI metal resource class
macOS instance with Xcode 12.5.1. This change fixes that logic and adds
further checks to make the code future-proof.

Here too people are complaining that the returned country code migth be
null: https://stackoverflow.com/questions/15202454/nslocalecountrycode-returns-nil

Signed-off-by: Darshan Sen <darshan.sen@postman.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants