Skip to content

Commit 22629e2

Browse files
committed
💚 make PMD happy
1 parent b7b2cb3 commit 22629e2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

personalization-service/src/main/java/de/muenchen/dbs/personalization/checklist/ChecklistService.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,9 @@ private Checklist getChecklistOrThrowException(final UUID checklistId) {
7979
private String getUserMailFromAuthenticationOrThrow() {
8080
final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
8181
if (authentication.getPrincipal() instanceof Jwt jwt) {
82-
Object emailClaim = jwt.getClaims().get("email");
83-
if (emailClaim != null) {
84-
final String email = emailClaim.toString();
85-
if (!StringUtils.isBlank(email)) {
86-
return email;
87-
}
82+
final Object emailClaim = jwt.getClaims().get("email");
83+
if (emailClaim != null && !StringUtils.isBlank(emailClaim.toString())) {
84+
return emailClaim.toString();
8885
}
8986
}
9087
throw new ResponseStatusException(HttpStatus.UNAUTHORIZED);

0 commit comments

Comments
 (0)