diff options
author | zsfelfoldi <zsfelfoldi@gmail.com> | 2015-04-06 14:01:36 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2015-04-20 03:57:49 +0800 |
commit | 94489b2269133c545aa3e9580737b2bd93f3ead0 (patch) | |
tree | bd486d5c4c432763dbc356f5f6ea79768f186603 /common/docserver | |
parent | e2d333d2095edb349388433c28f4d6a381b1df62 (diff) | |
download | dexon-94489b2269133c545aa3e9580737b2bd93f3ead0.tar dexon-94489b2269133c545aa3e9580737b2bd93f3ead0.tar.gz dexon-94489b2269133c545aa3e9580737b2bd93f3ead0.tar.bz2 dexon-94489b2269133c545aa3e9580737b2bd93f3ead0.tar.lz dexon-94489b2269133c545aa3e9580737b2bd93f3ead0.tar.xz dexon-94489b2269133c545aa3e9580737b2bd93f3ead0.tar.zst dexon-94489b2269133c545aa3e9580737b2bd93f3ead0.zip |
s
Diffstat (limited to 'common/docserver')
-rw-r--r-- | common/docserver/docserver.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/common/docserver/docserver.go b/common/docserver/docserver.go index 8e943c186..5e076aa7e 100644 --- a/common/docserver/docserver.go +++ b/common/docserver/docserver.go @@ -55,7 +55,11 @@ func (self *DocServer) RegisterProtocols(schemes map[string]func(*DocServer) htt func (self *DocServer) GetAuthContent(uri string, hash common.Hash) (content []byte, err error) { // retrieve content resp, err := self.Client().Get(uri) - defer resp.Body.Close() + defer func() { + if resp != nil { + resp.Body.Close() + } + }() if err != nil { return } |