Merge: * filters: don't fail on filter update when filter file doesn't exist

Close #1112

* commit '0737354f534385c3c2036e15d65554bcb7090fb4':
  * filters: don't fail on filter update when filter file doesn't exist
This commit is contained in:
Simon Zolin 2019-10-23 19:19:50 +03:00
commit 9d29fdea4b

View File

@ -436,7 +436,7 @@ func (filter *filter) save() error {
func (filter *filter) saveAndBackupOld() error {
filterFilePath := filter.Path()
err := os.Rename(filterFilePath, filterFilePath+".old")
if err != nil {
if err != nil && !os.IsNotExist(err) {
return err
}
return filter.save()