From 22c5c803cae74b6b7090581bc8cd118cbec4fc10 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 17 Nov 2015 09:17:19 -0200 Subject: [PATCH] KEYCLOAK-2100: 500 Internal Server Error with Update the events provider via Admin REST API --- .../org/keycloak/services/managers/RealmManager.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/services/src/main/java/org/keycloak/services/managers/RealmManager.java b/services/src/main/java/org/keycloak/services/managers/RealmManager.java index 688c242f9a..d44a622828 100755 --- a/services/src/main/java/org/keycloak/services/managers/RealmManager.java +++ b/services/src/main/java/org/keycloak/services/managers/RealmManager.java @@ -50,6 +50,7 @@ import org.keycloak.timer.TimerProvider; import java.util.Collections; import java.util.HashSet; import java.util.List; +import static java.lang.Boolean.TRUE; import org.keycloak.models.ProtocolMapperModel; import org.keycloak.protocol.ProtocolMapperUtils; @@ -221,9 +222,12 @@ public class RealmManager implements RealmImporter { if(rep.getEnabledEventTypes() != null) { realm.setEnabledEventTypes(new HashSet<>(rep.getEnabledEventTypes())); } - - realm.setAdminEventsEnabled(rep.isAdminEventsEnabled()); - realm.setAdminEventsDetailsEnabled(rep.isAdminEventsDetailsEnabled()); + if(rep.isAdminEventsEnabled() != null) { + realm.setAdminEventsEnabled(rep.isAdminEventsEnabled()); + } + if(rep.isAdminEventsDetailsEnabled() != null){ + realm.setAdminEventsDetailsEnabled(rep.isAdminEventsDetailsEnabled()); + } } private void setupMasterAdminManagement(RealmModel realm) {