From 01a45e06355d1a75b062e2b975c709560bf3dce1 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Tue, 18 Aug 2015 20:02:39 -0700 Subject: [PATCH] fix cannot find challengeId of undefined --- server/boot/challenge.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/boot/challenge.js b/server/boot/challenge.js index fc17828f2a..761bcc9711 100644 --- a/server/boot/challenge.js +++ b/server/boot/challenge.js @@ -137,7 +137,9 @@ module.exports = function(app) { // unless the next block is undefined, which means no next block let nextChallengeName = firstChallenge; - const challengeId = req.user.currentChallenge.challengeId; + const challengeId = req.user.currentChallenge ? + req.user.currentChallenge.challengeId : + 'bd7123c8c441eddfaeb5bdef'; // find challenge return challenge$ .map(challenge => challenge.toJSON())