From d8bd12a3024f15fed30458b2bb79de79f66f2925 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 5 May 2023 13:37:09 +0100 Subject: [PATCH] Fix macos update check exploding (#944) --- src/updater.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/updater.ts b/src/updater.ts index 8d22a8c..4a38562 100644 --- a/src/updater.ts +++ b/src/updater.ts @@ -39,7 +39,7 @@ async function safeCheckForUpdate(): Promise { try { const res = await global.fetch(feedUrl); const { currentRelease } = await res.json(); - const latestVersionDownloaded = latestUpdateDownloaded.releaseName; + const latestVersionDownloaded = latestUpdateDownloaded?.releaseName; console.info( `Latest version from release download: ${currentRelease} (current: ${app.getVersion()}, most recent downloaded ${latestVersionDownloaded}})`, ); @@ -131,7 +131,7 @@ interface ICachedUpdate { } // cache the latest update which has been downloaded as electron offers no api to read it -let latestUpdateDownloaded: ICachedUpdate; +let latestUpdateDownloaded: ICachedUpdate | undefined; autoUpdater .on("update-available", function () { ipcChannelSendUpdateStatus(true);