Skip to content

Commit

Permalink
Fix handling of a deleted doc, so the error message to the user is cl…
Browse files Browse the repository at this point in the history
…earer. (#766)

Added a null check so the code ends up displaying a message to the user, "No
available documents can fulfill the request," rather than the generic, "An
error has occurred."

This hits when running OpenID4VP verification from the verifier server to
an empty wallet.

Signed-off-by: Kevin Deus <[email protected]>
  • Loading branch information
kdeus authored Oct 31, 2024
1 parent 8a74282 commit 4ffa288
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ class OpenID4VPPresentationActivity : FragmentActivity() {
// prefer the credential which is on-screen if possible
val credentialIdFromPager: String? = settingsModel.focusedCardId.value
if (credentialIdFromPager != null
// Sometimes the focused card ID references an old deleted card, in which case
// lookupDocument will return null, so we still need to check for that:
&& walletApp.documentStore.lookupDocument(credentialIdFromPager) != null
&& canDocumentSatisfyRequest(credentialIdFromPager, credentialFormat, docType)
) {
return documentStore.lookupDocument(credentialIdFromPager)
Expand Down

0 comments on commit 4ffa288

Please sign in to comment.