From ef9b5a6f152a526aa82d34a99108edfc80712630 Mon Sep 17 00:00:00 2001 From: develar Date: Tue, 28 Feb 2017 21:30:33 +0100 Subject: [PATCH] fix(auto-updater): handle errors during emit Close #1310 --- packages/electron-updater/src/AppUpdater.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/electron-updater/src/AppUpdater.ts b/packages/electron-updater/src/AppUpdater.ts index 84223c0f2d1..998e0ff3feb 100644 --- a/packages/electron-updater/src/AppUpdater.ts +++ b/packages/electron-updater/src/AppUpdater.ts @@ -131,14 +131,14 @@ export abstract class AppUpdater extends EventEmitter { } private async _checkForUpdates(): Promise { - await this.untilAppReady + try { + await this.untilAppReady - if (this.logger != null) { - this.logger.info("Checking for update") - } + if (this.logger != null) { + this.logger.info("Checking for update") + } - this.emit("checking-for-update") - try { + this.emit("checking-for-update") return await this.doCheckForUpdates() } catch (e) {