From ec893ae07554e37ba4e04773b346b5b80e71e152 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 28 May 2019 09:36:46 +0200 Subject: [PATCH] Fix crash in files cache --- server/lib/files-cache/abstract-video-static-file-cache.ts | 4 ++-- 1 file 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 { 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 })) -- 2.41.0