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 Dec 10, 2024
1 parent d52b1de commit fb316d7
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 fb316d7

Please sign in to comment.