diff options
| author | Pitu <[email protected]> | 2021-01-05 11:19:56 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2021-01-05 11:19:56 +0900 |
| commit | f2e270d28435a945aa5eba2104902d969b07b089 (patch) | |
| tree | 0bbb0a595d8641e0dcf4955dcea2aa9106dc025d /src/api/utils/Util.js | |
| parent | Add meta name to pages (diff) | |
| download | host.fuwn.me-f2e270d28435a945aa5eba2104902d969b07b089.tar.xz host.fuwn.me-f2e270d28435a945aa5eba2104902d969b07b089.zip | |
fix: try to remove thumbnail only if the file has one
Diffstat (limited to 'src/api/utils/Util.js')
| -rw-r--r-- | src/api/utils/Util.js | 2 |
1 files changed, 1 insertions, 1 deletions
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 |