Fix(nav): Protect against missing data

This commit is contained in:
Berkeley Martinez
2016-08-04 15:01:37 -07:00
parent c3c640d00a
commit f0955aea5c
2 changed files with 16 additions and 7 deletions

View File

@@ -22,12 +22,17 @@ export const firstChallengeSelector = createSelector(
) {
return {};
}
return challengeMap[
blockMap[
superBlockMap[
superBlocks[0]
].blocks[0]
].challenges[0]
];
try {
return challengeMap[
blockMap[
superBlockMap[
superBlocks[0]
].blocks[0]
].challenges[0]
];
} catch (err) {
console.error(err);
return {};
}
}
);