Skip to content

Commit eac383b

Browse files
scott.waye@hubse.netbgavrilMS
authored andcommitted
add null protection.
1 parent cf893dc commit eac383b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/client/Microsoft.Identity.Client/TokenResponseHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static string GetUsernameFromIdToken(IdToken idToken)
4747
public static string GetHomeAccountId(AuthenticationRequestParameters requestParams, MsalTokenResponse response, IdToken idToken)
4848
{
4949
ClientInfo clientInfo = response.ClientInfo != null ? ClientInfo.CreateFromJson(response.ClientInfo) : null;
50-
string homeAccountId = clientInfo?.ToAccountIdentifier() ?? idToken?.Subject ?? requestParams.Account.HomeAccountId.Identifier; // ADFS does not have client info, so we use subject
50+
string homeAccountId = clientInfo?.ToAccountIdentifier() ?? idToken?.Subject ?? requestParams.Account?.HomeAccountId?.Identifier; // ADFS does not have client info, so we use subject
5151

5252
if (homeAccountId == null)
5353
{

0 commit comments

Comments
 (0)