diff --git a/lib/app/shared/helper_functions/helper_functions.dart b/lib/app/shared/helper_functions/helper_functions.dart index d073e9b96..7afcd5208 100644 --- a/lib/app/shared/helper_functions/helper_functions.dart +++ b/lib/app/shared/helper_functions/helper_functions.dart @@ -504,23 +504,31 @@ Future getOIDC4VCTypeForIssuance({ final authorizationServer = openidConfigurationResponse['authorization_server']; - List subjectSyntaxTypesSupported; + List? subjectSyntaxTypesSupported; if (authorizationServer == null) { - subjectSyntaxTypesSupported = - openidConfigurationResponse['subject_syntax_types_supported'] - as List; + if (openidConfigurationResponse + .containsKey('subject_syntax_types_supported')) { + subjectSyntaxTypesSupported = + openidConfigurationResponse['subject_syntax_types_supported'] + as List; + } } else { final openidConfigurationResponse = await getOpenIdConfig( baseUrl: authorizationServer.toString(), client: client.dio, ); - subjectSyntaxTypesSupported = - openidConfigurationResponse['subject_syntax_types_supported'] - as List; + + if (openidConfigurationResponse + .containsKey('subject_syntax_types_supported')) { + subjectSyntaxTypesSupported = + openidConfigurationResponse['subject_syntax_types_supported'] + as List; + } } - if (!subjectSyntaxTypesSupported.contains('did:key')) { + if (subjectSyntaxTypesSupported != null && + !subjectSyntaxTypesSupported.contains('did:key')) { throw Exception('Subject_Syntax_Type_Not_Supported'); }