diff --git a/backend/b2/b2.go b/backend/b2/b2.go index 307a45ea8..a6f45bf13 100644 --- a/backend/b2/b2.go +++ b/backend/b2/b2.go @@ -479,12 +479,9 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e f.setRoot(newRoot) _, err := f.NewObject(ctx, leaf) if err != nil { - if err == fs.ErrorObjectNotFound { - // File doesn't exist so return old f - f.setRoot(oldRoot) - return f, nil - } - return nil, err + // File doesn't exist so return old f + f.setRoot(oldRoot) + return f, nil } // return an error with an fs which points to the parent return f, fs.ErrorIsFile