aboutsummaryrefslogtreecommitdiffstats
path: root/common/docserver
diff options
context:
space:
mode:
authorzsfelfoldi <zsfelfoldi@gmail.com>2015-04-06 14:01:36 +0800
committerzelig <viktor.tron@gmail.com>2015-04-20 03:57:49 +0800
commit94489b2269133c545aa3e9580737b2bd93f3ead0 (patch)
treebd486d5c4c432763dbc356f5f6ea79768f186603 /common/docserver
parente2d333d2095edb349388433c28f4d6a381b1df62 (diff)
downloaddexon-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.go6
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
}