Fix uncaught exception during shutdown on update

This commit is contained in:
Fedor Indutny 2021-05-06 14:32:23 -07:00 committed by GitHub
parent 504a967be1
commit bcd79cf17d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -67,7 +67,10 @@ async function start(options = {}) {
}
async function stop() {
logger.info('attachment_downloads/stop: disabling');
// If `.start()` wasn't called - the `logger` is `undefined`
if (logger) {
logger.info('attachment_downloads/stop: disabling');
}
enabled = false;
if (timeout) {
clearTimeout(timeout);