From bcd79cf17df67c64bce56121f27ea2207b37220d Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Thu, 6 May 2021 14:32:23 -0700 Subject: [PATCH] Fix uncaught exception during shutdown on update --- js/modules/attachment_downloads.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/modules/attachment_downloads.js b/js/modules/attachment_downloads.js index 01936bf83031..91e6cb18f646 100644 --- a/js/modules/attachment_downloads.js +++ b/js/modules/attachment_downloads.js @@ -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);