Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit e3994de

Browse files
committed
Fixing the V4 ES check
1 parent e3322d7 commit e3994de

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/services/challengeService.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,16 +500,18 @@ async function mapTimelineTemplateId (trackId, typeId) {
500500
* @returns {Object} v5ChallengeObject
501501
*/
502502
async function buildV5Challenge (legacyId, challengeListing, challengeDetails) {
503-
if (!challengeListing) {
503+
if (!challengeListing || challengeListing === null) {
504+
logger.debug(`Challenge listing not passed, pulling from V4ES for ${legacyId}`)
504505
const challengeListingObj = await getChallengeListingFromV4ES(legacyId)
505506
challengeListing = challengeListingObj.data
506507
}
507-
if (!challengeDetails) {
508+
if (!challengeDetails || challengeDetails === null) {
509+
logger.debug(`Challenge details not passed, pulling from V4ES for ${legacyId}`)
508510
const challengeDetailObj = await getChallengeDetailFromV4ES(legacyId)
509511
challengeDetails = challengeDetailObj.data
510512
}
511513

512-
if (!challengeListing) {
514+
if (!challengeListing || challengeListing === null) {
513515
throw Error(`Challenge Listing Not Found in v4 Index ${JSON.stringify(challengeListing)}`)
514516
}
515517

0 commit comments

Comments
 (0)