Skip to content

Commit

Permalink
Resolve race condition with blurImg
Browse files Browse the repository at this point in the history
blurImg can already be nulled out by the time the rAF function
is called, so we have to check there as well.
  • Loading branch information
seantimm committed Oct 5, 2018
1 parent 367f462 commit dffa93b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/blur-up/ls.blur-up.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@

if(blurImg){
lazySizes.rAF(function () {
lazySizes.aC(blurImg, 'ls-blur-up-loaded');
if(blurImg) {
lazySizes.aC(blurImg, 'ls-blur-up-loaded');
}
});

blurImg.removeEventListener('load', onloadBlurUp);
Expand Down

0 comments on commit dffa93b

Please sign in to comment.