crypt: add missing error check spotted by linter

This commit is contained in:
Nick Craig-Wood 2024-02-29 14:46:31 +00:00
parent 4c6d2c5410
commit 186bb85c44

View File

@ -566,7 +566,10 @@ func (f *Fs) MkdirMetadata(ctx context.Context, dir string, metadata fs.Metadata
return nil, err
}
var entries = make(fs.DirEntries, 0, 1)
f.addDir(ctx, &entries, newDir)
err = f.addDir(ctx, &entries, newDir)
if err != nil {
return nil, err
}
newDir, ok := entries[0].(fs.Directory)
if !ok {
return nil, fmt.Errorf("internal error: expecting %T to be fs.Directory", entries[0])