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>
This commit is contained in:
parent
43e0929339
commit
30c8b1b84f
1 changed files with 2 additions and 2 deletions
|
@ -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)")
|
||||
|
|
Loading…
Reference in a new issue