From 7ff61aa87be8c05f61736161c463ef6a3c545507 Mon Sep 17 00:00:00 2001 From: Mark Severson Date: Tue, 29 Jun 2021 22:01:35 -0600 Subject: [PATCH] Handle request errors in copymove --- requests.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/requests.go b/requests.go index df04d17..9e457db 100644 --- a/requests.go +++ b/requests.go @@ -142,7 +142,9 @@ func (c *Client) doCopyMove(method string, oldpath string, newpath string, overw func (c *Client) copymove(method string, oldpath string, newpath string, overwrite bool) error { s, data := c.doCopyMove(method, oldpath, newpath, overwrite) - defer data.Close() + if data != nil { + defer data.Close() + } switch s { case 201, 204: