Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix crash in files cache

Chocobozzzec893ae07554
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 1908cfb06f..c06355446c 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> {
maxAge,
max,
promise: true,
- dispose: (result: GetFilePathResult) => {
- if (result.isOwned !== true) {
+ dispose: (result?: GetFilePathResult) => {
+ if (result && result.isOwned !== true) {
remove(result.path)
.then(() => logger.debug('%s removed from %s', result.path, this.constructor.name))
.catch(err => logger.error('Cannot remove %s from cache %s.', result.path, this.constructor.name, { err }))