Skip to content

Commit

Permalink
[kbss-cvut/record-manager-ui#202] Fix the bug while loading all users
Browse files Browse the repository at this point in the history
http-nio-8080-exec-7] WARN  o.s.w.s.m.s.DefaultHandlerExceptionResolver - Resolved [org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Cannot invoke "cz.cvut.kbss.study.model.RoleGroup.getRoles()" because "this.roleGroup" is null]
  • Loading branch information
palagdan authored and blcham committed Oct 9, 2024
1 parent bb06622 commit 349001c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/cz/cvut/kbss/study/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public void setRoleGroup(RoleGroup roleGroup) {
* @return {@code true} if this is admin, {@code false} otherwise
*/
public boolean isAdmin() {
return roleGroup.getRoles().contains(Role.administrator);
return roleGroup != null && roleGroup.getRoles().contains(Role.administrator);
}

public String getToken() {
Expand Down

0 comments on commit 349001c

Please sign in to comment.