From f0c71c97d1c6658c5b22eca2119384872d8a4364 Mon Sep 17 00:00:00 2001 From: Alexandr Stelnykovych Date: Mon, 14 Apr 2025 10:57:12 +0000 Subject: [PATCH] fix: [updater] crash when updater runs without UI instance --- service/updates/upgrade.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/service/updates/upgrade.go b/service/updates/upgrade.go index 7edf653f..d0c5331f 100644 --- a/service/updates/upgrade.go +++ b/service/updates/upgrade.go @@ -24,9 +24,11 @@ func (u *Updater) upgrade(downloader *Downloader, ignoreVersion bool) error { } } - // Unload UI assets to be able to move files on Windows. - u.instance.UI().EnableUpgradeLock() - defer u.instance.UI().DisableUpgradeLock() + // If we are running in a UI instance, we need to unload the UI assets + if u.instance != nil { + u.instance.UI().EnableUpgradeLock() + defer u.instance.UI().DisableUpgradeLock() + } // Execute the upgrade. upgradeError := u.upgradeMoveFiles(downloader)