mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Refactor calls to UIManagerHelper.getUIManager
Summary: This diff refactors the usages of UIManagerHelper.getUIManager() to make sure we always consider null objects. Some of the callsites were throwing a NullPointerExcetpion, now they throw a more explicit exception. changelog: [internal] Reviewed By: makovkastar Differential Revision: D19383064 fbshipit-source-id: 1806a37528e80cab1c8fdff5eb631aaf47bde819
This commit is contained in:
committed by
Facebook Github Bot
parent
edcbfb9821
commit
39089b4c45
@@ -1104,12 +1104,16 @@ public class ReactInstanceManager {
|
||||
Log.d(ReactConstants.TAG, "ReactInstanceManager.attachRootViewToInstance()");
|
||||
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "attachRootViewToInstance");
|
||||
|
||||
// UIManager is technically Nullable here, but if we can't get a UIManager
|
||||
// at this point, something has probably gone horribly wrong so it's probably best
|
||||
// to throw a NullPointerException.
|
||||
@Nullable
|
||||
UIManager uiManager =
|
||||
UIManagerHelper.getUIManager(mCurrentReactContext, reactRoot.getUIManagerType());
|
||||
|
||||
// If we can't get a UIManager something has probably gone horribly wrong
|
||||
if (uiManager == null) {
|
||||
throw new IllegalStateException(
|
||||
"Unable to attache a rootView to ReactInstance when UIManager is not properly initialized.");
|
||||
}
|
||||
|
||||
@Nullable Bundle initialProperties = reactRoot.getAppProperties();
|
||||
|
||||
final int rootTag =
|
||||
|
||||
Reference in New Issue
Block a user