From 66cf2df7801e0d5f28c5c29a2e04faef9d2a5006 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 15 Jul 2014 11:15:48 +0100 Subject: [PATCH] drive: check errors in Open() better --- drive/drive.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drive/drive.go b/drive/drive.go index 3caed3b31..071e429f7 100644 --- a/drive/drive.go +++ b/drive/drive.go @@ -929,7 +929,10 @@ func (o *FsObjectDrive) Storable() bool { // Open an object for read func (o *FsObjectDrive) Open() (in io.ReadCloser, err error) { - req, _ := http.NewRequest("GET", o.url, nil) + req, err := http.NewRequest("GET", o.url, nil) + if err != nil { + return nil, err + } req.Header.Set("User-Agent", fs.UserAgent) res, err := o.drive.client.Do(req) if err != nil {