Fix crash in RNTester when removing/developing tests (#23406)

Summary:
Ensure that the current openExample (stored in AsyncStorage) exists in the module list.

It's possible for the example to be missing if a test was removed & previously open in RNTester OR when actively developing RNTester tests & switching between branches

[General] [Fixed] - Potential crash in RNTester when removing/developing test cases
Pull Request resolved: https://github.com/facebook/react-native/pull/23406

Differential Revision: D14055695

Pulled By: cpojer

fbshipit-source-id: 6cf00e097e934f7a342e7d210b6319e1cba142ca
This commit is contained in:
Brent Erickson
2019-02-12 13:53:18 -08:00
committed by Facebook Github Bot
parent 36e026ee89
commit da6a26548b
+1 -1
View File
@@ -110,7 +110,7 @@ class RNTesterApp extends React.Component<Props, RNTesterNavigationState> {
}
if (this.state.openExample) {
const Component = RNTesterList.Modules[this.state.openExample];
if (Component.external) {
if (Component && Component.external) {
return <Component onExampleExit={this._handleBack} />;
} else {
return (