mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Dispatching ViewCommands to a non-existent tag should log SoftException, but not crash
Summary: Patch for T63997094. Will still crash in debug mode, and log soft errors, so as not to entirely hide errors. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20473855 fbshipit-source-id: 8b052b1ae3c886f83d6a7922feb158172cdcd33d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
bac9e69593
commit
5296a740a7
+11
-4
@@ -24,6 +24,7 @@ import com.facebook.react.R;
|
||||
import com.facebook.react.bridge.Callback;
|
||||
import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
|
||||
import com.facebook.react.bridge.ReactContext;
|
||||
import com.facebook.react.bridge.ReactSoftException;
|
||||
import com.facebook.react.bridge.ReadableArray;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.bridge.SoftAssertions;
|
||||
@@ -765,8 +766,11 @@ public class NativeViewHierarchyManager {
|
||||
UiThreadUtil.assertOnUiThread();
|
||||
View view = mTagsToViews.get(reactTag);
|
||||
if (view == null) {
|
||||
throw new IllegalViewOperationException(
|
||||
"Trying to send command to a non-existing view " + "with tag " + reactTag);
|
||||
ReactSoftException.logSoftException(
|
||||
TAG,
|
||||
new IllegalViewOperationException(
|
||||
"Trying to send command to a non-existing view " + "with tag " + reactTag));
|
||||
return;
|
||||
}
|
||||
|
||||
ViewManager viewManager = resolveViewManager(reactTag);
|
||||
@@ -778,8 +782,11 @@ public class NativeViewHierarchyManager {
|
||||
UiThreadUtil.assertOnUiThread();
|
||||
View view = mTagsToViews.get(reactTag);
|
||||
if (view == null) {
|
||||
throw new IllegalViewOperationException(
|
||||
"Trying to send command to a non-existing view " + "with tag " + reactTag);
|
||||
ReactSoftException.logSoftException(
|
||||
TAG,
|
||||
new IllegalViewOperationException(
|
||||
"Trying to send command to a non-existing view " + "with tag " + reactTag));
|
||||
return;
|
||||
}
|
||||
|
||||
ViewManager viewManager = resolveViewManager(reactTag);
|
||||
|
||||
Reference in New Issue
Block a user