Skip to content

Commit

Permalink
[SHIBUI-1029]
Browse files Browse the repository at this point in the history
Added a filter to remove admins that have no email addressees from the
new user email sending.
  • Loading branch information
Bill Smith committed Jan 24, 2019
1 parent c4043ea commit d6ff6dd
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import edu.internet2.tier.shibboleth.admin.ui.security.model.User;
import edu.internet2.tier.shibboleth.admin.ui.security.repository.UserRepository;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.ResourceBundleMessageSource;
Expand Down Expand Up @@ -72,6 +73,6 @@ public String[] getSystemAdminEmailAddresses() {
logger.warn("No users with ROLE_ADMIN were found! Check your configuration!");
systemAdmins = new HashSet<>();
}
return systemAdmins.stream().map(User::getEmailAddress).distinct().toArray(String[]::new);
return systemAdmins.stream().filter(user -> StringUtils.isNotBlank(user.getEmailAddress())).map(User::getEmailAddress).distinct().toArray(String[]::new);
}
}

0 comments on commit d6ff6dd

Please sign in to comment.