Skip to content

Commit e8991f3

Browse files
scott.waye@hubse.netbgavrilMS
authored andcommitted
add null protection.
1 parent 601272e commit e8991f3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)