From 5b179420fdcb669c9272344d45c96a69d8a6ed88 Mon Sep 17 00:00:00 2001 From: John Ament Date: Tue, 22 Aug 2017 00:57:49 -0400 Subject: [PATCH] KEYCLOAK-5274: Check that authenticator config id is null before attempting to fetch it. (#4404) --- .../admin/AuthenticationManagementResource.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java b/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java index 61f6254710..9503e02ea5 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java @@ -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()); + } } }