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

This commit is contained in:
John Ament 2017-08-22 00:57:49 -04:00 committed by Stian Thorgersen
parent 83d3dfbc54
commit 5b179420fd

View file

@ -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());
}
}
}