diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/util/ReactFindViewUtil.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/util/ReactFindViewUtil.java index 1d0d41d82c..cd3104ae37 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/util/ReactFindViewUtil.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/util/ReactFindViewUtil.java @@ -129,19 +129,11 @@ public class ReactFindViewUtil { } } - Iterator>> - viewIterator = mOnMultipleViewsFoundListener.entrySet().iterator(); - while (viewIterator.hasNext()) { - Map.Entry> entry = - viewIterator.next(); - Set nativeIds = entry.getValue(); - if (nativeIds.contains(nativeId)) { - entry.getKey().onViewFound(view, nativeId); - nativeIds.remove(nativeId); // remove it from list of NativeIds to search for. - } - if (nativeIds.isEmpty()) { - viewIterator.remove(); - } + for (Map.Entry> entry : mOnMultipleViewsFoundListener.entrySet()) { + Set nativeIds = entry.getValue(); + if (nativeIds != null && nativeIds.contains(nativeId)) { + entry.getKey().onViewFound(view, nativeId); + } } }