mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix EventEmitter crash for events that are sent to a stopped surface
Summary: In SurfaceMountingManager/MountingManager/FabricUIManager infra, we try to blackhole events that are sent to a stopped surface. In this case I just forgot to add a null check. Add here to protect against events sent to stopped surfaces - for example, if a TextInput is focused when the surface is stopped, a "blur" event will be sent and will crash here otherwise. Now it blackholes silently, as expected. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D26031260 fbshipit-source-id: 9936466ca2d00267efaf7fa594c9bcd59f7aad2a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ee10932e26
commit
595b569ead
+3
@@ -766,6 +766,9 @@ public class SurfaceMountingManager {
|
||||
}
|
||||
|
||||
private @Nullable ViewState getNullableViewState(int tag) {
|
||||
if (mTagToViewState == null) {
|
||||
return null;
|
||||
}
|
||||
return mTagToViewState.get(tag);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user