KEYCLOAK-5274: Check that authenticator config id is null before attempting to fetch it. (#4404)

This commit is contained in:
John Ament authored and Stian Thorgersen committed 2017-08-22 06:57:49 +02:00
1 parent 83d3dfbc54
commit 5b179420fd
1 file changed
+6 -3
@@ -509,10 +509,13 @@ public class AuthenticationManagementResource {
rep.setId(execution.getId());
if (factory.isConfigurable()) {
AuthenticatorConfigModel authenticatorConfig = realm.getAuthenticatorConfigById(execution.getAuthenticatorConfig());
String authenticatorConfigId = execution.getAuthenticatorConfig();
if(authenticatorConfigId != null) {
AuthenticatorConfigModel authenticatorConfig = realm.getAuthenticatorConfigById(authenticatorConfigId);
if (authenticatorConfig != null) {
rep.setAlias(authenticatorConfig.getAlias());
if (authenticatorConfig != null) {
rep.setAlias(authenticatorConfig.getAlias());
}
}
}