From 30c8b1b84f548f08740148c6e9a086146af1f60d Mon Sep 17 00:00:00 2001 From: Anagh Kumar Baranwal <6824881+darthShadow@users.noreply.github.com> Date: Mon, 9 Nov 2020 18:06:10 +0530 Subject: [PATCH] fs: Fix nil pointer on copy & move operations directly to remote Fix the copy and move operations that broke in 127f0fc when copying directly to a remote without a specific destination. Signed-off-by: Anagh Kumar Baranwal <6824881+darthShadow@users.noreply.github.com> --- fs/operations/operations.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/operations/operations.go b/fs/operations/operations.go index 64bf6db48..406e27a1c 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -511,7 +511,7 @@ func Copy(ctx context.Context, f fs.Fs, dst fs.Object, remote string, src fs.Obj return newDst, err } } - if src.String() != newDst.String() { + if newDst != nil && src.String() != newDst.String() { fs.Infof(src, "%s to: %s", actionTaken, newDst.String()) } else { fs.Infof(src, actionTaken) @@ -569,7 +569,7 @@ func Move(ctx context.Context, fdst fs.Fs, dst fs.Object, remote string, src fs. newDst, err = doMove(ctx, src, remote) switch err { case nil: - if src.String() != newDst.String() { + if newDst != nil && src.String() != newDst.String() { fs.Infof(src, "Moved (server-side) to: %s", newDst.String()) } else { fs.Infof(src, "Moved (server-side)")