diff --git a/server/boot/challenge.js b/server/boot/challenge.js index 54c28c983c..fc17828f2a 100644 --- a/server/boot/challenge.js +++ b/server/boot/challenge.js @@ -320,7 +320,7 @@ module.exports = function(app) { var challengeData = { id: challengeId, - name: req.body.challengeInfo.challengeName, + name: req.body.challengeInfo.challengeName || '', completedDate: Math.round(+new Date()), solution: req.body.challengeInfo.solution, challengeType: 5 @@ -399,7 +399,7 @@ module.exports = function(app) { { id: id || challengeId, completedDate: completedDate, - name: name || challengeName, + name: name || challengeName || '', solution: null, githubLink: null, verified: true @@ -446,7 +446,7 @@ module.exports = function(app) { var challengeData = { id: challengeId, - name: req.body.challengeInfo.challengeName, + name: req.body.challengeInfo.challengeName || '', completedDate: completedDate, solution: solutionLink, githubLink: githubLink, diff --git a/server/boot/user.js b/server/boot/user.js index 1ed1381240..be063d47e1 100644 --- a/server/boot/user.js +++ b/server/boot/user.js @@ -156,7 +156,7 @@ module.exports = function(app) { }); const bonfires = user.completedChallenges.filter(function(obj) { - return obj.challengeType === 5 && obj.name.match(/Bonfire/g); + return obj.challengeType === 5 && (obj.name || '').match(/Bonfire/g); }); res.render('account/show', {