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 Saadnajmi committed Jan 14, 2023
1 parent 68c0177 commit 7ffef7c
Showing 1 changed file with 3 additions and 2 deletions.
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 7ffef7c

Please sign in to comment.