From 548da4bf179004936763e459a695029058a4a90f Mon Sep 17 00:00:00 2001 From: HL Date: Thu, 28 Apr 2016 21:39:50 +0800 Subject: [PATCH] Fixed undefined navigationState. --- src/meteorSwitch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meteorSwitch.js b/src/meteorSwitch.js index 9cd5cfc..c583381 100644 --- a/src/meteorSwitch.js +++ b/src/meteorSwitch.js @@ -22,7 +22,7 @@ module.exports = (getMeteorData) => { const selected = navState.children.filter(el=>el.sceneKey==selectedKey) || console.error("key="+selectedKey+" doesn't exist"); const navigationState = selected[0] || console.error("Cannot find scene with key="+selectedKey); - if (navigationState.key != navState.children[navState.index].key){ + if (!navigationState || navigationState.key != navState.children[navState.index].key){ Actions[selectedKey](); }