Skip to content

Commit

Permalink
Merge pull request #466 from dailymotion/fix/fallback-when-empty-vast
Browse files Browse the repository at this point in the history
fix bug where fallback was not working if first ad element return empty
  • Loading branch information
ZacharieTFR authored Jun 26, 2024
2 parents 5be8d9d + f91874b commit e7d4c38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser/vast_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ export class VASTParser extends EventEmitter {
return Promise.all(resolveWrappersPromises).then((unwrappedAds) => {
const resolvedAds = util.flatten(unwrappedAds);

if (!resolvedAds && this.remainingAds.length > 0) {
if (!resolvedAds.length && this.remainingAds.length > 0) {
const remainingAdsToResolve = this.remainingAds.shift();

return this.resolveAds(remainingAdsToResolve, {
Expand Down

0 comments on commit e7d4c38

Please sign in to comment.