write bundle only if neccessary (OCIS-363)

This commit is contained in:
A.Unger
2020-08-19 16:20:07 +02:00
committed by Benedikt Kulmann
parent 9c8b505a2f
commit 038b9144af
+6 -3
View File
@@ -117,9 +117,12 @@ func (s Store) RemoveSettingFromBundle(bundleID string, settingID string) error
if err != nil {
return nil
}
removeSetting(bundle, settingID)
_, err = s.WriteBundle(bundle)
return err
if ok := removeSetting(bundle, settingID); ok {
if _, err := s.WriteBundle(bundle); err != nil {
return err
}
}
return nil
}
// indexOfSetting finds the index of the given setting within the given bundle.