From f2e270d28435a945aa5eba2104902d969b07b089 Mon Sep 17 00:00:00 2001 From: Pitu Date: Tue, 5 Jan 2021 11:19:56 +0900 Subject: fix: try to remove thumbnail only if the file has one --- src/api/utils/Util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/api/utils/Util.js') diff --git a/src/api/utils/Util.js b/src/api/utils/Util.js index e52fac2..c703ad5 100644 --- a/src/api/utils/Util.js +++ b/src/api/utils/Util.js @@ -127,7 +127,7 @@ class Util { const thumbName = ThumbUtil.getFileThumbnail(filename); try { await jetpack.removeAsync(path.join(Util.uploadPath, filename)); - await ThumbUtil.removeThumbs(thumbName); + if (thumbName) await ThumbUtil.removeThumbs(thumbName); if (deleteFromDB) { await db -- cgit v1.2.3