From 8207af9460fa7984b2b013567cd20e58d0ac585d Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 31 Aug 2017 21:19:54 +0100 Subject: [PATCH] b2: Fix SHA1 mismatch when downloading files with no SHA1 #678 Some large files (depending on which version of rclone they were uploaded with and where they were uploaded from) don't have an SHA1, so we can't check it in that case. --- b2/b2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2/b2.go b/b2/b2.go index bc93ac7ae..cbdfc9e79 100644 --- a/b2/b2.go +++ b/b2/b2.go @@ -1133,7 +1133,7 @@ func (file *openFile) Close() (err error) { // Check the SHA1 receivedSHA1 := file.o.sha1 calculatedSHA1 := fmt.Sprintf("%x", file.hash.Sum(nil)) - if receivedSHA1 != calculatedSHA1 { + if receivedSHA1 != "" && receivedSHA1 != calculatedSHA1 { return errors.Errorf("object corrupted on transfer - SHA1 mismatch (want %q got %q)", receivedSHA1, calculatedSHA1) }