Skip to content

Commit 732f937

Browse files
luanmmebozduman
authored andcommitted
Fix System.NullReferenceException on IAMAWSProvider.
1 parent b517250 commit 732f937

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Minio/Credentials/IAMAWSProvider.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,10 @@ internal AccessCredentials GetAccessCredentials(string tokenFile)
116116
{
117117
Validate();
118118
var url = CustomEndPoint;
119-
var urlStr = url.Authority;
120-
if (url is null || string.IsNullOrWhiteSpace(urlStr))
119+
if (url is null || string.IsNullOrWhiteSpace(url.Authority))
121120
{
122121
var region = Environment.GetEnvironmentVariable("AWS_REGION");
123-
urlStr = region is null ? "https://sts.amazonaws.com" : "https://sts." + region + ".amazonaws.com";
122+
var urlStr = region is null ? "https://sts.amazonaws.com" : "https://sts." + region + ".amazonaws.com";
124123
url = new Uri(urlStr);
125124
}
126125

0 commit comments

Comments
 (0)