diff options
author | Chocobozzz <me@florianbigard.com> | 2019-05-28 09:36:46 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-05-28 10:16:58 +0200 |
commit | ec893ae07554e37ba4e04773b346b5b80e71e152 (patch) | |
tree | cd62381e515400429e08093e64fa89acfb9629ac | |
parent | 465679cafdd172f2d71234a379654269e125f34a (diff) | |
download | PeerTube-ec893ae07554e37ba4e04773b346b5b80e71e152.tar.gz PeerTube-ec893ae07554e37ba4e04773b346b5b80e71e152.tar.zst PeerTube-ec893ae07554e37ba4e04773b346b5b80e71e152.zip |
Fix crash in files cache
-rw-r--r-- | server/lib/files-cache/abstract-video-static-file-cache.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/files-cache/abstract-video-static-file-cache.ts b/server/lib/files-cache/abstract-video-static-file-cache.ts index 1908cfb06..c06355446 100644 --- a/server/lib/files-cache/abstract-video-static-file-cache.ts +++ b/server/lib/files-cache/abstract-video-static-file-cache.ts | |||
@@ -18,8 +18,8 @@ export abstract class AbstractVideoStaticFileCache <T> { | |||
18 | maxAge, | 18 | maxAge, |
19 | max, | 19 | max, |
20 | promise: true, | 20 | promise: true, |
21 | dispose: (result: GetFilePathResult) => { | 21 | dispose: (result?: GetFilePathResult) => { |
22 | if (result.isOwned !== true) { | 22 | if (result && result.isOwned !== true) { |
23 | remove(result.path) | 23 | remove(result.path) |
24 | .then(() => logger.debug('%s removed from %s', result.path, this.constructor.name)) | 24 | .then(() => logger.debug('%s removed from %s', result.path, this.constructor.name)) |
25 | .catch(err => logger.error('Cannot remove %s from cache %s.', result.path, this.constructor.name, { err })) | 25 | .catch(err => logger.error('Cannot remove %s from cache %s.', result.path, this.constructor.name, { err })) |