fix: try to remove thumbnail only if the file has one

This commit is contained in:
Pitu 2021-01-05 11:19:56 +09:00
parent 5e219868b0
commit f2e270d284
1 changed files with 1 additions and 1 deletions

View File

@ -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