Skip to content

fix: activity nullability #39

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
Jul 10, 2022
Merged

fix: activity nullability #39

merged 1 commit into from
Jul 10, 2022

Conversation

kirillzyusko
Copy link
Owner

@kirillzyusko kirillzyusko commented Jul 6, 2022

Description

Rewrite !! operator to null checks with early return statements.

Fixes #38

Motivation and Context

Operator !! is not safe and we should avoid the usage of it everywhere it's possible, since it forces compiler to think that the object will never be null (but we are living in a real world, and you never know in advance the value of the object is coming to you).

Using this operator may lead to undesired crashes.

Changelog

Android

  • Rewrite !! operator to null checks with early return statements;

How Has This Been Tested?

Checklist

  • CI successfully passed

@kirillzyusko kirillzyusko marked this pull request as ready for review July 10, 2022 09:20
@kirillzyusko kirillzyusko merged commit 9f16421 into main Jul 10, 2022
@kirillzyusko kirillzyusko deleted the bugfix/NPE branch July 10, 2022 09:20
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.

Rare and random NullPointerException in createViewInstance
1 participant