Fix "Cannot read property 'anchor' of undefined"

replace unnecessary filter with for loop and break
This commit is contained in:
mike-000
2020-02-29 10:12:48 +00:00
committed by GitHub
parent 5ba978311e
commit ce6d7bd55c

View File

@@ -610,11 +610,12 @@ class View extends BaseObject {
animationCallback(series[0].callback, false);
}
if (!anchor) {
const animations = series.filter(function(animation) {
return !animation.complete;
});
if (animations.length > 0) {
anchor = animations[0].anchor;
for (let j = 0, jj = series.length; j < jj; ++j) {
const animation = series[j];
if (!animation.complete) {
anchor = animation.anchor;
break;
}
}
}
}