Skip to content

Commit a4b1463

Browse files
GiteaBotdelvh
andauthored
Use correct minio error (#26634) (#26639)
Backport #26634 by @delvh Previously, `err` was defined above, checked for `err == nil` and used nowhere else. Hence, the result of `convertMinioErr` would always be `nil`. This leads to a NPE further down the line. That is not intentional, it should convert the error of the most recent operation, not one of its predecessors. Found through https://discord.com/channels/322538954119184384/322538954119184384/1143185780206993550. Co-authored-by: delvh <dev.lh@web.de>
1 parent f43df2f commit a4b1463

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/storage/minio.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ func NewMinioStorage(ctx context.Context, cfg *setting.Storage) (ObjectStorage,
9191
}
9292

9393
// Check to see if we already own this bucket
94-
exists, errBucketExists := minioClient.BucketExists(ctx, config.Bucket)
95-
if errBucketExists != nil {
94+
exists, err := minioClient.BucketExists(ctx, config.Bucket)
95+
if err != nil {
9696
return nil, convertMinioErr(err)
9797
}
9898

0 commit comments

Comments
 (0)