mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-18 03:28:19 +01:00
chore: always return local version if update check fails (#485)
This commit is contained in:
@@ -266,8 +266,13 @@ func rpcSetDevChannelState(enabled bool) error {
|
||||
func rpcGetUpdateStatus() (*UpdateStatus, error) {
|
||||
includePreRelease := config.IncludePreRelease
|
||||
updateStatus, err := GetUpdateStatus(context.Background(), GetDeviceID(), includePreRelease)
|
||||
// to ensure backwards compatibility,
|
||||
// if there's an error, we won't return an error, but we will set the error field
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error checking for updates: %w", err)
|
||||
if updateStatus == nil {
|
||||
return nil, fmt.Errorf("error checking for updates: %w", err)
|
||||
}
|
||||
updateStatus.Error = err.Error()
|
||||
}
|
||||
|
||||
return updateStatus, nil
|
||||
|
||||
Reference in New Issue
Block a user