Fix crash in files cache

pull/1856/head
Chocobozzz 2019-05-28 09:36:46 +02:00
parent 465679cafd
commit ec893ae075
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 2 additions and 2 deletions

View File

@ -18,8 +18,8 @@ export abstract class AbstractVideoStaticFileCache <T> {
maxAge, maxAge,
max, max,
promise: true, promise: true,
dispose: (result: GetFilePathResult) => { dispose: (result?: GetFilePathResult) => {
if (result.isOwned !== true) { if (result && result.isOwned !== true) {
remove(result.path) remove(result.path)
.then(() => logger.debug('%s removed from %s', result.path, this.constructor.name)) .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 })) .catch(err => logger.error('Cannot remove %s from cache %s.', result.path, this.constructor.name, { err }))