From dffa93b804302363aceb7dc814b01629014ed03b Mon Sep 17 00:00:00 2001 From: Sean Timm Date: Fri, 5 Oct 2018 14:22:31 -0600 Subject: [PATCH] Resolve race condition with blurImg blurImg can already be nulled out by the time the rAF function is called, so we have to check there as well. --- plugins/blur-up/ls.blur-up.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/blur-up/ls.blur-up.js b/plugins/blur-up/ls.blur-up.js index 32142e41..7537ea89 100644 --- a/plugins/blur-up/ls.blur-up.js +++ b/plugins/blur-up/ls.blur-up.js @@ -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);