Closed shubham-si closed 4 months ago
Hello ! thank you for reporting this issue, we will take a look at it asap !
@Rapha0511 is the bug fixed ?
@shubham-si Hello, the bug has been fixed and released in 6.0.0 version ! I'm closing this issue, but but feel free to reopen it if you have any further problems.
https://github.com/dailymotion/vast-client-js/blob/master/src/parser/vast_parser.js#L461C25-L461C25
const resolvedAds = util.flatten(unwrappedAds);
default to[]
Linkif (!resolvedAds && this.remainingAds.length > 0) {
There seems to be a issue here
!resolvedAds
. Since!Array<T>
givesfalse
always, thus the code within if will not be executed at all.So If any Ad element (going from top to bottom) fails to fetch xml or return empty vast, it will not fallback to next Ad Element.
Fix:
if (resolvedAds.length === 0 && this.remainingAds.length > 0) {
so that if resolvedAds fails and we have remainingAds, can be proceeded with them.