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

View file

@ -67,7 +67,10 @@ async function start(options = {}) {
} }
async function stop() { 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; enabled = false;
if (timeout) { if (timeout) {
clearTimeout(timeout); clearTimeout(timeout);