Fix NullPointerException during tear down of RN Android

Summary:
This diff prevents a NullPointerException caused by a race condition in the tear down of React Native.

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D29135942

fbshipit-source-id: 76d5a1f16c2ca63a146b56c761f5f9595dcfe2a5
This commit is contained in:
David Vacca
2021-06-15 10:21:27 -07:00
committed by Facebook GitHub Bot
parent a7adaf3062
commit 2f943d9d63
@@ -1340,7 +1340,12 @@ public class ReactInstanceManager {
new ComponentNameResolver() {
@Override
public String[] getComponentNames() {
return getViewManagerNames().toArray(new String[0]);
List<String> viewManagerNames = getViewManagerNames();
if (viewManagerNames == null) {
FLog.e(TAG, "No ViewManager names found");
return new String[0];
}
return viewManagerNames.toArray(new String[0]);
}
});
catalystInstance.setGlobalVariable("__fbStaticViewConfig", "true");