Skip to content

Commit 4f1df40

Browse files
authored
Merge pull request #493 from dailymotion/fix-non-linear
Fix error 303 triggered during non linear ad parsing
2 parents 6fc124e + 9688891 commit 4f1df40

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/parser/vast_parser.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,12 +447,14 @@ export class VASTParser extends EventEmitter {
447447
} else {
448448
for (let index = vastResponse.ads.length - 1; index >= 0; index--) {
449449
// - Error encountered while parsing
450-
// - No Creative case - The parser has dealt with soma <Ad><Wrapper> or/and an <Ad><Inline> elements
450+
// - No Creative case - The parser has dealt with some <Ad><Wrapper> or/and an <Ad><Inline> elements
451451
// but no creative was found
452452
const ad = vastResponse.ads[index];
453453
const noMediaFilesAvailable = !ad.creatives.some(
454-
(creative) => creative.mediaFiles?.length > 0
454+
(creative) =>
455+
creative.mediaFiles?.length > 0 || creative.variations?.length > 0
455456
);
457+
456458
if ((ad.errorCode || noMediaFilesAvailable) && !ad.VASTAdTagURI) {
457459
// If VASTAdTagURI is in the vastResponse, it means we are dealing with a Wrapper when using parseVAST from the VASTParser.
458460
// In that case, we dont want to modify the vastResponse since the creatives node is not required in a wrapper.

0 commit comments

Comments
 (0)