aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-03-14 13:53:03 -0700
committerChris Lu <chris.lu@gmail.com>2020-03-14 13:53:03 -0700
commit17efa361f9aa0aeed4ec751fa084ea556f748523 (patch)
tree4876a78f3fa9201d6a013aed6b7dec35a7a60b55
parent91e0a987e451424d1136a0e543b90b3e68dc30f9 (diff)
downloadseaweedfs-17efa361f9aa0aeed4ec751fa084ea556f748523.tar.xz
seaweedfs-17efa361f9aa0aeed4ec751fa084ea556f748523.zip
fix possible nil
-rw-r--r--weed/operation/upload_content.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go
index 52f8f9e2b..3101dc191 100644
--- a/weed/operation/upload_content.go
+++ b/weed/operation/upload_content.go
@@ -120,9 +120,11 @@ func doUploadData(uploadUrl string, filename string, cipher bool, data []byte, i
}, filename, contentIsGzipped, mtype, pairMap, jwt)
}
- uploadResult.Size = uint32(clearDataLen)
- if contentIsGzipped {
- uploadResult.Gzip = 1
+ if uploadResult != nil {
+ uploadResult.Size = uint32(clearDataLen)
+ if contentIsGzipped {
+ uploadResult.Gzip = 1
+ }
}
return uploadResult, err