From d9458fb4ee9aa1490f715d00b7435b64f001e9a5 Mon Sep 17 00:00:00 2001
From: Nick Craig-Wood <nick@craig-wood.com>
Date: Mon, 18 Jan 2016 17:53:03 +0000
Subject: [PATCH] b2: return error in Hash from readFileMetadata operation

---
 b2/b2.go | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/b2/b2.go b/b2/b2.go
index 82dbbbf00..e76b61634 100644
--- a/b2/b2.go
+++ b/b2/b2.go
@@ -4,6 +4,9 @@ package b2
 // FIXME if b2 could set the mod time then it has everything else to
 // implement mod times.  It is just missing that bit of API.
 
+// FIXME should we remove sha1 checks from here as rclone now supports
+// checking SHA1s?
+
 import (
 	"bytes"
 	"crypto/sha1"
@@ -607,14 +610,16 @@ func (o *Object) Remote() string {
 }
 
 // Hash returns the Sha-1 of an object returning a lowercase hex string
-// Hash returns the Md5sum of an object returning a lowercase hex string
 func (o *Object) Hash(t fs.HashType) (string, error) {
 	if t != fs.HashSHA1 {
 		return "", fs.ErrHashUnsupported
 	}
 
 	// Error is logged in readFileMetadata
-	_ = o.readFileMetadata()
+	err := o.readFileMetadata()
+	if err != nil {
+		return "", err
+	}
 	return o.sha1, nil
 }