From ead669524ef7ccd45a942564332da3492c33181a Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Mon, 17 Jan 2022 06:31:00 -0800 Subject: [PATCH] Check if the allocated views set for exists for surface on mount Summary: Adds a check to verify that we are not trying to insert a new view id into a non-existent set. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D33621031 fbshipit-source-id: 8468af69bea250a70d656789ea819c39b55a9de6 --- .../com/facebook/react/fabric/jni/FabricMountingManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/FabricMountingManager.cpp b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/FabricMountingManager.cpp index b245604c759..e88af4c2299 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/FabricMountingManager.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/FabricMountingManager.cpp @@ -413,7 +413,8 @@ void FabricMountingManager::executeMount( } } - if (shouldRememberAllocatedViews_) { + if (shouldRememberAllocatedViews_ && + allocatedViewsIterator != allocatedViewRegistry_.end()) { auto &views = allocatedViewsIterator->second; for (auto const &mutation : mutations) { switch (mutation.type) {