mirror of
https://github.com/safing/portmaster
synced 2025-04-25 13:29:10 +00:00
fix: [updater] crash when updater runs without UI instance
This commit is contained in:
parent
7d5a8fd1dc
commit
f0c71c97d1
1 changed files with 5 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue