mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
NativeAnimatedModule should not crash if UIManager disappears
Summary: If UIManager disappears, it's likely due to (1) teardown due to memory pressure, (2) teardown due to crash, (3) normal teardown. In all of those cases, I would just want NativeAnimatedModule to stop executing and fail silently ASAP. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D22079209 fbshipit-source-id: 21650abdfdb119a6f4abccd6962d0c09f7c7c6cd
This commit is contained in:
committed by
Facebook GitHub Bot
parent
fa0e6f8051
commit
2e2c881147
+8
-2
@@ -16,6 +16,8 @@ import com.facebook.react.bridge.Callback;
|
||||
import com.facebook.react.bridge.JSApplicationCausedNativeException;
|
||||
import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.bridge.ReactNoCrashSoftException;
|
||||
import com.facebook.react.bridge.ReactSoftException;
|
||||
import com.facebook.react.bridge.ReadableArray;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.bridge.UIManager;
|
||||
@@ -321,8 +323,12 @@ import java.util.Queue;
|
||||
UIManager uiManager =
|
||||
UIManagerHelper.getUIManagerForReactTag(mReactApplicationContext, viewTag);
|
||||
if (uiManager == null) {
|
||||
throw new IllegalStateException(
|
||||
"Animated node could not be connected to UIManager: " + viewTag);
|
||||
ReactSoftException.logSoftException(
|
||||
TAG,
|
||||
new ReactNoCrashSoftException(
|
||||
"Animated node could not be connected to UIManager - uiManager disappeared for tag: "
|
||||
+ viewTag));
|
||||
return;
|
||||
}
|
||||
|
||||
PropsAnimatedNode propsAnimatedNode = (PropsAnimatedNode) node;
|
||||
|
||||
Reference in New Issue
Block a user