From 4f2673583a3fa9b03addcdf652df678599c4a081 Mon Sep 17 00:00:00 2001 From: yancongwen Date: Mon, 9 Dec 2019 11:30:56 +0800 Subject: [PATCH] fix:downloader bug when image size > MAX_SPACE_IN_B --- lib/downloader.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/downloader.js b/lib/downloader.js index 3fae8e7..b1b6b1e 100644 --- a/lib/downloader.js +++ b/lib/downloader.js @@ -155,6 +155,9 @@ function reset() { } function doLru(size) { + if (size > MAX_SPACE_IN_B) { + return Promise.reject() + } return new Promise((resolve, reject) => { let totalSize = savedFiles[KEY_TOTAL_SIZE] ? savedFiles[KEY_TOTAL_SIZE] : 0;