Skip to content

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

Merged
miquelbeltran merged 1 commit intomainfrom
fix/3505
Mar 3, 2025
Merged

fix(device_info_plus): handle nullability on getString(DEVICE_NAME)#3507
miquelbeltran merged 1 commit intomainfrom
fix/3505

Conversation

@miquelbeltran
Copy link
Copy Markdown
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
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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