mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-19 09:52:32 +01:00
fix(usbgadget): do not panic if a change isn't found (#481)
* fix(usbgadget): do not panic if a change isn't found * chore(usbgadget): rebind usb after updating config
This commit is contained in:
@@ -48,6 +48,11 @@ func (c *ChangeSetResolver) doResolveChanges(initial bool) error {
|
||||
|
||||
for _, key := range c.orderedChanges {
|
||||
change := c.changesMap[key.(string)]
|
||||
if change == nil {
|
||||
c.l.Error().Str("key", key.(string)).Msg("fileChange not found")
|
||||
continue
|
||||
}
|
||||
|
||||
if !initial {
|
||||
change.ResetActionResolution()
|
||||
}
|
||||
@@ -123,7 +128,11 @@ func (c *ChangeSetResolver) applyChanges() error {
|
||||
|
||||
err := c.changeset.applyChange(change)
|
||||
if err != nil {
|
||||
return err
|
||||
if change.IgnoreErrors {
|
||||
c.l.Warn().Str("change", change.String()).Err(err).Msg("ignoring error")
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user