fix: [updater] crash when updater runs without UI instance
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user