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

Prevent from crashing with null cannot be cast to non-null type kotlin.Any #489

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

lukmccall
Copy link
Contributor

Summary

It's possible for the getInitialWindowMetrics method to return null, which can cause crashes if we force cast it to Any. I faced issues with reloading the app, resulting in errors:

ERROR  Error: Exception in HostObject::get for prop 'RNCSafeAreaContext': java.lang.NullPointerException: null cannot be cast to non-null type kotlin.Any, js engine: hermes

I'm unsure of the expected behavior when getInitialWindowMetrics returns null, but the current exception doesn't provide enough information.

Test Plan

  • Tested in expo app ✅

@janicduplessis
Copy link
Collaborator

Looks good, thanks!

@janicduplessis janicduplessis merged commit afeba42 into AppAndFlow:main Apr 11, 2024
1 of 2 checks passed
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.

2 participants