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)