From 18cda6adbb67e9963ffe21856cd152ce0333a0df Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 14 Mar 2020 13:55:32 -0700 Subject: [PATCH] cleaner fix --- weed/operation/upload_content.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go index 3101dc191..6806f7cf8 100644 --- a/weed/operation/upload_content.go +++ b/weed/operation/upload_content.go @@ -120,11 +120,13 @@ func doUploadData(uploadUrl string, filename string, cipher bool, data []byte, i }, filename, contentIsGzipped, mtype, pairMap, jwt) } - if uploadResult != nil { - uploadResult.Size = uint32(clearDataLen) - if contentIsGzipped { - uploadResult.Gzip = 1 - } + if uploadResult == nil { + return + } + + uploadResult.Size = uint32(clearDataLen) + if contentIsGzipped { + uploadResult.Gzip = 1 } return uploadResult, err