Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Commit 906745d

Browse files
authored
Merge pull request #777 from jeschu1/nullcheck
devops: fix null reference if no parameter exists
2 parents 1e5b53c + 0dfe666 commit 906745d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

AzureDevOps.Authentication/Src/Authentication.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public override async Task<bool> DeleteCredentials(TargetUri targetUri)
238238

239239
var value = header.Parameter;
240240

241-
if (value.Length >= AuthorizationUriPrefix.Length + AuthorityHostUrlBase.Length + GuidStringLength)
241+
if (value?.Length >= AuthorizationUriPrefix.Length + AuthorityHostUrlBase.Length + GuidStringLength)
242242
{
243243
// The header parameter will look something like "authorization_uri=https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47"
244244
// and all we want is the portion after the '=' and before the last '/'.

0 commit comments

Comments
 (0)