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

NPE crash when navigating back from ReactNativeActivity to Native activity. #256

Closed
floynn-shopify opened this issue Mar 29, 2022 · 0 comments · Fixed by #257
Closed

NPE crash when navigating back from ReactNativeActivity to Native activity. #256

floynn-shopify opened this issue Mar 29, 2022 · 0 comments · Fixed by #257

Comments

@floynn-shopify
Copy link

Steps to reproduce:

  1. Checkout https://github.com/Shopify/mobile/tree/segment_list_prototype_with_flash_list
  2. Run the android app.
  3. Navigate to Store tab.
  4. Swipe debug menu from the right side of the screen and enable Feature Flags -> CustomerSegmentListRN.
  5. Click Customers. You should be able to see your segment list implemented via FlashList
  6. Click <- arrow in the upper right corner to navigate back and observe the crash.
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'android.view.ViewParent android.view.ViewParent.getParent()' on a null object reference
        at com.shopify.reactnative.flash_list.AutoLayoutView.dispatchDraw(AutoLayoutView.kt:33)
        at android.view.View.updateDisplayListIfDirty(View.java:21510)
        at android.view.View.draw(View.java:22375)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
        at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:772)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4313)
        at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:744)
        	... 95 more

It looks like it's happening here

val scrollContainerSize = (parent.parent as View).let {
due to parent view being null at this point.

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 a pull request may close this issue.

1 participant