{"record":{"id":"c774514819695c44","repo":"microg/GmsCore","slug":"no-response-set","errorCode":null,"errorMessage":"No response set.","messagePattern":"No response set\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"play-services-fido/src/main/java/com/google/android/gms/fido/fido2/api/common/PublicKeyCredential.java","lineNumber":102,"sourceCode":"    public AuthenticationExtensionsClientOutputs getClientExtensionResults() {\n        return clientExtensionResults;\n    }\n\n    @Nullable\n    public String getId() {\n        return id;\n    }\n\n    @Nullable\n    public byte[] getRawId() {\n        return rawId;\n    }\n\n    public AuthenticatorResponse getResponse() {\n        if (registerResponse != null) return registerResponse;\n        if (signResponse != null) return signResponse;\n        if (errorResponse != null) return errorResponse;\n        throw new IllegalStateException(\"No response set.\");\n    }\n\n    @NonNull\n    public String getType() {\n        return type;\n    }\n\n    /**\n     * Builder for {@link PublicKeyCredential}.\n     */\n    public static class Builder {\n        @NonNull\n        private String id;\n        @NonNull\n        private byte[] rawId;\n        private AuthenticatorResponse response;\n        @Nullable\n        private AuthenticationExtensionsClientOutputs extensionsClientOutputs;","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-fido/src/main/java/com/google/android/gms/fido/fido2/api/common/PublicKeyCredential.java#L84-L120","documentation":"PublicKeyCredential.getResponse() returns whichever of registerResponse, signResponse, or errorResponse was set. If a PublicKeyCredential was constructed with none of them, getResponse() throws IllegalStateException \"No response set.\", signaling an internally inconsistent credential object.","triggerScenarios":"Reading getResponse() on a PublicKeyCredential deserialized/built without any response field populated — e.g. from a Parcel or JSONObject where id/type were present but response was missing or null.","commonSituations":"Parsing a FIDO server/API response that omitted the response object; a failed parse path where errorResponse wasn't set; constructing PublicKeyCredential manually in tests with only id and type.","solutions":["Check registerResponse/signResponse/errorResponse (or the source JSON) for null before calling getResponse().","Ensure the PublicKeyCredential is built through the library's Creator/fromJson path with a complete response.","If an error response is expected on failure, make sure the error branch actually sets errorResponse."],"exampleFix":"// before\nAuthenticatorResponse resp = credential.getResponse();\n// after\nif (credential.getRegisterResponse() != null) {\n    AuthenticatorAttestationResponse resp = credential.getRegisterResponse();\n} else if (credential.getSignResponse() != null) {\n    AuthenticatorAssertionResponse resp = credential.getSignResponse();\n} else { /* handle missing/error */ }","handlingStrategy":"validation","validationCode":"boolean hasResponse = credential.getRegisterResponse() != null || credential.getSignResponse() != null || credential.getErrorResponse() != null;","typeGuard":"boolean hasResponse(PublicKeyCredential c) { return c.getRegisterResponse() != null || c.getSignResponse() != null || c.getErrorResponse() != null; }","tryCatchPattern":"try { response = credential.getResponse(); } catch (IllegalStateException e) { if (\"No response set.\".equals(e.getMessage())) response = null; else throw e; }","preventionTips":["Check the individual getXxxResponse accessors before calling getResponse().","Validate that the source JSON contained a non-empty response object before building the credential.","Handle FIDO error paths by inspecting errorResponse explicitly."],"tags":["fido","webauthn","invalid-state","android"],"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"}