Skip to content

Commit 6360c7b

Browse files
Fix null reference for compilation
1 parent f072880 commit 6360c7b

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

Yubico.YubiKey/src/Yubico/YubiKey/Fido2/Commands/EnumerateRpsBeginResponse.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,15 @@ public EnumerateRpsBeginResponse(ResponseApdu responseApdu)
7272
{
7373
var credentialManagementData = _response.GetData();
7474

75-
bool conditionsMet =
76-
credentialManagementData.RelyingParty is not null &&
77-
credentialManagementData.RelyingPartyIdHash is not null &&
78-
credentialManagementData.TotalRelyingPartyCount is not null &&
79-
credentialManagementData.RelyingParty.IsMatchingRelyingPartyId(credentialManagementData.RelyingPartyIdHash.Value);
80-
81-
if (conditionsMet)
75+
if (credentialManagementData.RelyingParty is not null &&
76+
credentialManagementData.RelyingPartyIdHash is not null &&
77+
credentialManagementData.TotalRelyingPartyCount is not null &&
78+
credentialManagementData.RelyingParty.IsMatchingRelyingPartyId(credentialManagementData.RelyingPartyIdHash.Value))
8279
{
80+
8381
return (credentialManagementData.TotalRelyingPartyCount.Value, credentialManagementData.RelyingParty);
84-
}
82+
83+
}
8584

8685
throw new Ctap2DataException(ExceptionMessages.InvalidFido2Info);
8786
}

Yubico.YubiKey/src/Yubico/YubiKey/Fido2/Commands/EnumerateRpsGetNextResponse.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,9 @@ public RelyingParty GetData()
4444
{
4545
var credentialManagementData = _response.GetData();
4646

47-
bool conditionsMet =
48-
credentialManagementData.RelyingParty is not null &&
47+
if (credentialManagementData.RelyingParty is not null &&
4948
credentialManagementData.RelyingPartyIdHash is not null &&
50-
credentialManagementData.RelyingParty.IsMatchingRelyingPartyId(credentialManagementData.RelyingPartyIdHash.Value);
51-
52-
if (conditionsMet)
49+
credentialManagementData.RelyingParty.IsMatchingRelyingPartyId(credentialManagementData.RelyingPartyIdHash.Value))
5350
{
5451
return credentialManagementData.RelyingParty;
5552
}

0 commit comments

Comments
 (0)