mirror of https://github.com/Chocobozzz/PeerTube
Fix crash in files cache
parent
465679cafd
commit
ec893ae075
|
@ -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 }))
|
||||||
|
|
Loading…
Reference in New Issue