{"record":{"id":"eca99819902ea31e","repo":"microg/GmsCore","slug":"no-pendingintent-available","errorCode":null,"errorMessage":"No PendingIntent available","messagePattern":"No PendingIntent available","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"play-services-fido/src/main/java/org/microg/gms/fido/fido2/Fido2PendingIntentImpl.java","lineNumber":28,"sourceCode":"import android.content.IntentSender;\n\nimport com.google.android.gms.fido.fido2.Fido2PendingIntent;\n\npublic class Fido2PendingIntentImpl implements Fido2PendingIntent {\n    private PendingIntent pendingIntent;\n\n    public Fido2PendingIntentImpl(PendingIntent pendingIntent) {\n        this.pendingIntent = pendingIntent;\n    }\n\n    @Override\n    public boolean hasPendingIntent() {\n        return pendingIntent != null;\n    }\n\n    @Override\n    public void launchPendingIntent(Activity activity, int requestCode) throws IntentSender.SendIntentException {\n        if (!hasPendingIntent()) throw new IllegalStateException(\"No PendingIntent available\");\n        activity.startIntentSenderForResult(pendingIntent.getIntentSender(), requestCode, null, 0, 0, 0);\n    }\n}\n","sourceCodeStart":10,"sourceCodeEnd":32,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-fido/src/main/java/org/microg/gms/fido/fido2/Fido2PendingIntentImpl.java#L10-L32","documentation":"Fido2PendingIntentImpl.launchPendingIntent() starts the FIDO activity's IntentSender in the caller's activity. It throws IllegalStateException when called without a pendingIntent having been set, i.e. when hasPendingIntent() is false. The object simply has nothing to launch.","triggerScenarios":"Calling launchPendingIntent(activity, requestCode) on a Fido2PendingIntentImpl constructed with a null PendingIntent, or after checking hasPendingIntent() returns false and proceeding anyway.","commonSituations":"A FIDO registration/sign request that completed without needing user interaction (no consent dialog required), so no PendingIntent was produced; calling launchPendingIntent unconditionally after the API call instead of checking hasPendingIntent() first.","solutions":["Check hasPendingIntent() and skip launchPendingIntent when it returns false — completion likely needs no UI.","If a UI flow is expected, verify the Fido2 API call (register/sign) succeeded and returned a valid Fido2PendingIntent.","Wrap the call in try-catch for IllegalStateException to treat 'no PendingIntent' as a no-op success path."],"exampleFix":"// before\npendingIntent.launchPendingIntent(activity, REQUEST_CODE);\n// after\nif (pendingIntent.hasPendingIntent()) {\n    pendingIntent.launchPendingIntent(activity, REQUEST_CODE);\n} else {\n    // no user interaction required; poll result directly\n}","handlingStrategy":"validation","validationCode":"if (!fido2PendingIntent.hasPendingIntent()) { /* no UI needed; skip launch */ }","typeGuard":null,"tryCatchPattern":"try { fido2PendingIntent.launchPendingIntent(activity, RC); } catch (IllegalStateException e) { /* no PendingIntent: treat as no-op success */ }","preventionTips":["Always call hasPendingIntent() before launchPendingIntent().","Remember that not every FIDO operation requires user interaction — absence of a PendingIntent can be normal.","Verify the register/sign API call actually returned a result object rather than an error status."],"tags":["fido","android","pendingintent","invalid-state"],"backgroundTag":"invalid-state-transition","analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}