Skip to content

Commit

Permalink
Merge pull request #12 from KeKs0r/prevent-throw-on-route-change
Browse files Browse the repository at this point in the history
Prevent app crashing on route change
  • Loading branch information
dead authored Jul 11, 2019
2 parents 1c5e2b8 + 198d8c3 commit 8f2279c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Focusable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class Focusable extends Component {
this.context.navigationComponent.removeFocusableId(child.focusableId);

const currentFocusedPath = this.context.navigationComponent.currentFocusedPath;
if(!currentFocusedPath){
return
}
const index = currentFocusedPath.indexOf(child);

if (index > 0) {
Expand Down

0 comments on commit 8f2279c

Please sign in to comment.