fix: handle undefined contentLength in update download event

This commit is contained in:
Leafd 2025-10-03 14:37:43 -04:00
parent 68ffb2a04e
commit f8b4d9a434

View file

@ -281,7 +281,7 @@ async function downloadAndInstallUpdate() {
await update.downloadAndInstall((event) => {
switch (event.event) {
case 'Started':
contentLength = event.data.contentLength;
contentLength = event.data.contentLength ?? 0;
console.log(`Started downloading ${event.data.contentLength} bytes`);
break;
case 'Progress':