diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java index 26b4a2602d..bb6bedd914 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java @@ -412,11 +412,10 @@ public class RealmAdminResource { query.user(user); } - if (dateFrom != null && dateTo != null) { - query.fromDate(dateFrom).toDate(dateTo); - } else if(dateFrom != null) { + if(dateFrom != null) { query.fromDate(dateFrom); - } else if(dateTo != null) { + } + if(dateTo != null) { query.toDate(dateTo); }