Fix macos update check exploding (#944)

This commit is contained in:
Michael Telatynski 2023-05-05 13:37:09 +01:00 committed by GitHub
parent d3f687d040
commit d8bd12a302
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,7 +39,7 @@ async function safeCheckForUpdate(): Promise<void> {
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);