From 1645d3c18534324de795643974299de0d512d3f1 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 19 Nov 2013 02:12:56 -0800 Subject: [PATCH] avoid nil cases when error --- go/operation/submit.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/go/operation/submit.go b/go/operation/submit.go index 3c7d233ad..154e50719 100644 --- a/go/operation/submit.go +++ b/go/operation/submit.go @@ -132,7 +132,10 @@ func upload_one_chunk(filename string, reader io.Reader, master, replication str fileUrl, fid := "http://"+ret.PublicUrl+"/"+ret.Fid, ret.Fid glog.V(4).Info("Uploading part ", filename, " to ", fileUrl, "...") uploadResult, uploadError := Upload(fileUrl, filename, reader, false, "application/octet-stream") - return fid, uploadResult.Size, uploadError + if uploadError != nil { + return fid, 0, uploadError + } + return fid, uploadResult.Size, nil } func upload_file_id_list(fileUrl, filename string, fids []string) error {