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

Commit

Permalink
Merge pull request #777 from jeschu1/nullcheck
Browse files Browse the repository at this point in the history
devops: fix null reference if no parameter exists
  • Loading branch information
jeschu1 authored Oct 9, 2018
2 parents 1e5b53c + 0dfe666 commit 906745d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion AzureDevOps.Authentication/Src/Authentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public override async Task<bool> DeleteCredentials(TargetUri targetUri)

var value = header.Parameter;

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

0 comments on commit 906745d

Please sign in to comment.