Skip to content

Commit fbeb51e

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Fix NullPointerException when disaptching events
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
1 parent 52d8a79 commit fbeb51e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1026,13 +1026,14 @@ public View getView(int reactTag) {
10261026
}
10271027

10281028
private @Nullable ViewState getNullableViewState(int tag) {
1029-
if (mTagToViewState == null) {
1029+
ConcurrentHashMap<Integer, ViewState> viewStates = mTagToViewState;
1030+
if (viewStates == null) {
10301031
return null;
10311032
}
10321033
if (ReactFeatureFlags.enableDelayedViewStateDeletion) {
10331034
mScheduledForDeletionViewStateTags.remove(tag);
10341035
}
1035-
return mTagToViewState.get(tag);
1036+
return viewStates.get(tag);
10361037
}
10371038

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

0 commit comments

Comments
 (0)