diff options
author | delvh <dev.lh@web.de> | 2023-08-21 18:20:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-21 16:20:11 +0000 |
commit | 3d80308b36da2aa87f56c05d530f1e7970cd6f71 (patch) | |
tree | ee852531652e7e86dffa992b504756c7b80feb1e | |
parent | 0731abc44441048079444ba3d83eaeacc4814ed7 (diff) | |
download | gitea-3d80308b36da2aa87f56c05d530f1e7970cd6f71.tar.gz gitea-3d80308b36da2aa87f56c05d530f1e7970cd6f71.zip |
Use correct minio error (#26634)
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.
-rw-r--r-- | modules/storage/minio.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/storage/minio.go b/modules/storage/minio.go index f50f341022..3246993bb1 100644 --- a/modules/storage/minio.go +++ b/modules/storage/minio.go @@ -91,8 +91,8 @@ func NewMinioStorage(ctx context.Context, cfg *setting.Storage) (ObjectStorage, } // Check to see if we already own this bucket - exists, errBucketExists := minioClient.BucketExists(ctx, config.Bucket) - if errBucketExists != nil { + exists, err := minioClient.BucketExists(ctx, config.Bucket) + if err != nil { return nil, convertMinioErr(err) } |