Skip to content

Commit

Permalink
correction in get MemberUserAttributeConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
cgeorgilakis-grnet committed Mar 11, 2024
1 parent 55bd8f1 commit e1e8a48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public MemberUserAttributeConfigurationRepository(KeycloakSession session) {
}

public MemberUserAttributeConfigurationEntity getByRealm(String realmId){
return em.createNamedQuery("getConfigurationByRealm", MemberUserAttributeConfigurationEntity.class).setParameter("realmId",realmId).getResultStream().findAny().orElse(null);
return em.createNamedQuery("getConfigurationByRealm", MemberUserAttributeConfigurationEntity.class).setParameter("realmId",realmId).getResultStream().findAny().orElse(new MemberUserAttributeConfigurationEntity());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void run(KeycloakSession session) {
MemberUserAttributeConfigurationRepository memberUserAttributeConfigurationRepository = new MemberUserAttributeConfigurationRepository(session);
repository.dailyExecutedActions(session);
//create default eduPersonEntitlement configuration entity if not exist
if (memberUserAttributeConfigurationRepository.getByRealm(realm.getId()) == null) {
if (memberUserAttributeConfigurationRepository.getByRealm(realm.getId()).getId() == null) {
MemberUserAttributeConfigurationEntity configurationEntity = new MemberUserAttributeConfigurationEntity();
configurationEntity.setId(KeycloakModelUtils.generateId());
configurationEntity.setUserAttribute("eduPersonEntitlement");
Expand Down

0 comments on commit e1e8a48

Please sign in to comment.