don't make a backup of a nil state
This makes sure we don't create a backup of an intermediate state if the first read state was empty.
This commit is contained in:
parent
0a0eece15c
commit
d707049f72
|
@ -240,6 +240,12 @@ func (s *Filesystem) RefreshState() error {
|
|||
}
|
||||
|
||||
f, err := statefile.Read(reader)
|
||||
|
||||
// nothing to backup if there's no initial state
|
||||
if f == nil {
|
||||
s.writtenBackup = true
|
||||
}
|
||||
|
||||
// if there's no state we just assign the nil return value
|
||||
if err != nil && err != statefile.ErrNoState {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue