From bf8a9702a41d12582ad022b130731f8011a8f998 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 25 Apr 2016 12:47:08 -0700 Subject: [PATCH] tests: Fix a bug in TestObjectAPIIsUploadIDExists. (#1375) The following code crashes when upload ID does not exist, since we are setting err == nil when we find err == errFileNotFound. ``` if e == nil { t.Fatal(e.Error()) ``` Fix it. --- object-api-multipart_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/object-api-multipart_test.go b/object-api-multipart_test.go index b07554fd5..4042a74ad 100644 --- a/object-api-multipart_test.go +++ b/object-api-multipart_test.go @@ -106,10 +106,7 @@ func TestObjectAPIIsUploadIDExists(t *testing.T) { // UploadID file shouldn't exist. isExists, e := obj.isUploadIDExists(bucket, object, "abc") - if e == nil { - t.Fatal(e.Error()) - } - if isExists { + if e == nil && isExists { t.Fatal("Expected uploadIDPath to not to exist.") }