From dd71acbb9882d696515f8021159e202f8d46a494 Mon Sep 17 00:00:00 2001 From: robin <32926428+luobin01@users.noreply.github.com> Date: Fri, 2 Feb 2018 12:24:44 +0800 Subject: [PATCH] Update index.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当写错css文件里的图片路径,为防止进程挂掉,添加容错处理 --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index cdcf485..1634e2f 100644 --- a/index.js +++ b/index.js @@ -97,6 +97,10 @@ function lazyImageCSS(options) { } var info = fastImageSize(absolutePath); + + if(!info){ + continue; + } if (info.type === 'unknown') { console.log('' + 'unknown type: ' + absolutePath);