From 0ec0ae9dac575cd71a5930be4cfa41e1b314e022 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Thu, 7 Feb 2019 10:35:49 -0800 Subject: [PATCH] Protect against unhandled promises when calling checkForUpdates --- app/auto_update.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/auto_update.js b/app/auto_update.js index 26bc105ee..6725cf3cd 100644 --- a/app/auto_update.js +++ b/app/auto_update.js @@ -18,8 +18,12 @@ function autoUpdateDisabled() { ); } -function checkForUpdates() { - autoUpdater.checkForUpdates(); +async function checkForUpdates() { + try { + await autoUpdater.checkForUpdates(); + } catch (error) { + console.log('checkForUpdates error:', error.stack); + } } let showingDialog = false; @@ -58,7 +62,7 @@ function showUpdateDialog(mainWindow, messages) { } function onError(error) { - console.log('Got an error while updating: ', error.stack); + console.log('Got an error while updating:', error.stack); } function initialize(getMainWindow, messages) {