Skip to content

Commit

Permalink
Fix NullPointerException when disaptching events
Browse files Browse the repository at this point in the history
Summary:
This diff fixes a NullPointerException when disaptching events while the SurfaceMountingManager is being destroyed

changelog: [android] android

Reviewed By: cortinico

Differential Revision: D35559550

fbshipit-source-id: c07f74493384fb1b306338ec1bc8b96f1b6f1f41
  • Loading branch information
mdvacca authored and facebook-github-bot committed Apr 12, 2022
1 parent 52d8a79 commit fbeb51e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1026,13 +1026,14 @@ public View getView(int reactTag) {
}

private @Nullable ViewState getNullableViewState(int tag) {
if (mTagToViewState == null) {
ConcurrentHashMap<Integer, ViewState> viewStates = mTagToViewState;
if (viewStates == null) {
return null;
}
if (ReactFeatureFlags.enableDelayedViewStateDeletion) {
mScheduledForDeletionViewStateTags.remove(tag);
}
return mTagToViewState.get(tag);
return viewStates.get(tag);
}

@SuppressWarnings("unchecked") // prevents unchecked conversion warn of the <ViewGroup> type
Expand Down

0 comments on commit fbeb51e

Please sign in to comment.