From 1c90b65bca6cb27255f84eb541a74ca4b115ccd0 Mon Sep 17 00:00:00 2001 From: Ludy Date: Thu, 4 Jul 2024 23:04:21 +0200 Subject: [PATCH] removes empty list entries (#1523) --- .../software/SPDF/controller/web/AccountWebController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/stirling/software/SPDF/controller/web/AccountWebController.java b/src/main/java/stirling/software/SPDF/controller/web/AccountWebController.java index a70ae211..73d2a0c4 100644 --- a/src/main/java/stirling/software/SPDF/controller/web/AccountWebController.java +++ b/src/main/java/stirling/software/SPDF/controller/web/AccountWebController.java @@ -43,6 +43,7 @@ public class AccountWebController { @GetMapping("/login") public String login(HttpServletRequest request, Model model, Authentication authentication) { + if (authentication != null && authentication.isAuthenticated()) { return "redirect:/"; } @@ -72,6 +73,10 @@ public class AccountWebController { } } } + // Remove any null keys/values from the providerList + providerList + .entrySet() + .removeIf(entry -> entry.getKey() == null || entry.getValue() == null); model.addAttribute("providerlist", providerList); model.addAttribute("loginMethod", applicationProperties.getSecurity().getLoginMethod());