fix cannot read property match of undefined
This commit is contained in:
@ -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,
|
||||
|
@ -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', {
|
||||
|
Reference in New Issue
Block a user