File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
personalization-service/src/main/java/de/muenchen/dbs/personalization/checklist Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -79,9 +79,12 @@ private Checklist getChecklistOrThrowException(final UUID checklistId) {
79
79
private String getUserMailFromAuthenticationOrThrow () {
80
80
final Authentication authentication = SecurityContextHolder .getContext ().getAuthentication ();
81
81
if (authentication .getPrincipal () instanceof Jwt jwt ) {
82
- final String email = jwt .getClaims ().get ("email" ).toString ();
83
- if (!StringUtils .isBlank (email )) {
84
- return email ;
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
+ }
85
88
}
86
89
}
87
90
throw new ResponseStatusException (HttpStatus .UNAUTHORIZED );
You can’t perform that action at this time.
0 commit comments