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:
Joshua Gross
2021-01-22 19:32:15 -08:00
committed by Facebook GitHub Bot
parent ee10932e26
commit 595b569ead
@@ -766,6 +766,9 @@ public class SurfaceMountingManager {
}
private @Nullable ViewState getNullableViewState(int tag) {
if (mTagToViewState == null) {
return null;
}
return mTagToViewState.get(tag);
}