diff options
author | Chocobozzz <me@florianbigard.com> | 2019-05-28 09:36:46 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-05-28 09:36:46 +0200 |
commit | ff0bce13592da002a836caedf8daebcdd035260c (patch) | |
tree | 5500e76056c4c50aac14725ada86578f51366617 | |
parent | 78d60e63840f83b31ac3f86a0b667c8f1d5dbd92 (diff) | |
download | PeerTube-ff0bce13592da002a836caedf8daebcdd035260c.tar.gz PeerTube-ff0bce13592da002a836caedf8daebcdd035260c.tar.zst PeerTube-ff0bce13592da002a836caedf8daebcdd035260c.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 })) |