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

MXTools: Avoid releasing null pointer to fix crash on M1 simulator #1054

Merged
merged 1 commit into from
Mar 24, 2021

Conversation

Johennes
Copy link
Contributor

Due to a Simulator bug on the Apple M1, UTTypeCreatePreferredIdentifierForTag can unexpectedly return NULL. This causes a crash because the return value is later passed into CFRelease which explicitly disallows NULL arguments.

This commit fixes the issue by ensuring the return value is not NULL before proceeding.

Fixes: element-hq/element-ios#4140

Signed-off-by: Johannes Marbach [email protected]

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request updates CHANGES.rst
  • Pull request includes a sign off

Due to a Simulator bug on the Apple M1, `UTTypeCreatePreferredIdentifierForTag` can
unexpectedly return `NULL`. This causes a crash because the return value is later
passed into `CFRelease` which explicitly disallows `NULL` arguments.

This commit fixes the issue by ensuring the return value is not `NULL` before
proceeding.

Fixes: element-hq/element-ios#4140

Signed-off-by: Johannes Marbach <[email protected]>
Copy link
Contributor

@manuroe manuroe left a comment

Choose a reason for hiding this comment

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

👍

@manuroe manuroe merged commit d1ff2af into matrix-org:develop Mar 24, 2021
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.

Persistent crash on launch when running in iOS 14.4 simulator on M1 Mac
2 participants