From 7366e97dfc80b2ee8c0482d8d5cc7e67b8cde770 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 9 Nov 2021 13:00:51 +0000 Subject: [PATCH] mega: fix error handling broken by removal of github.com/pkg/errors There were instances of errors.Wrap being called with a nil error which the conversion didn't deal with correctly. --- backend/mega/mega.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/mega/mega.go b/backend/mega/mega.go index 7b38fdf58..7e154fe2d 100644 --- a/backend/mega/mega.go +++ b/backend/mega/mega.go @@ -602,7 +602,10 @@ func (f *Fs) Mkdir(ctx context.Context, dir string) error { return err } _, err = f.mkdir(ctx, rootNode, dir) - return fmt.Errorf("Mkdir failed: %w", err) + if err != nil { + return fmt.Errorf("Mkdir failed: %w", err) + } + return nil } // deleteNode removes a file or directory, observing useTrash