Fix null pointer exception in JSPointerDispatcher

Summary:
Changelog: [Internal] Fix null pointer exception in JSPointerDispatcher

Small regression introduced in D42817315 (https://github.com/facebook/react-native/commit/1e53f88b72e24ae2654b31f5c8bfbf8a07d51e09).

Reviewed By: javache

Differential Revision: D42965308

fbshipit-source-id: c1c4e907605d792f4be05800eb17af26cfea2bac
This commit is contained in:
Fabrizio Cucci
2023-02-02 09:30:43 -08:00
committed by Facebook GitHub Bot
parent 147a1f6619
commit 2d37f25f29
@@ -231,7 +231,10 @@ public class JSPointerDispatcher {
List<ViewTarget> activeHitPath;
if (isExitFromRoot) {
List<ViewTarget> lastHitPath = mLastHitPathByPointerId.get(eventState.getActivePointerId());
List<ViewTarget> lastHitPath =
mLastHitPathByPointerId != null
? mLastHitPathByPointerId.get(eventState.getActivePointerId())
: null;
if (lastHitPath == null || lastHitPath.isEmpty()) {
return;
}