Skip to content

fix(device_info_plus): handle nullability on getString(DEVICE_NAME) #3507

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

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

miquelbeltran
Copy link
Member

Description

Settings.Global.getString() can return null. And Any is not a subtype of nullable, so if getString() returns null the code will crash. Kotlin did not warn us about this.

https://developer.android.com/reference/android/provider/Settings.Global#getString(android.content.ContentResolver,%20java.lang.String)

Related Issues

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

@miquelbeltran miquelbeltran merged commit 3201e05 into main Mar 3, 2025
20 checks passed
@miquelbeltran miquelbeltran deleted the fix/3505 branch March 3, 2025 08:33
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.

[Bug]: java.lang.NullPointerException: getString(contentResolve…tings.Global.DEVICE_NAME) must not be null
1 participant