mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Check whether roles is non-empty before adding to userAndRoles
This commit is contained in:
parent
733530f0fe
commit
52f4914688
1 changed files with 7 additions and 3 deletions
|
|
@ -114,9 +114,13 @@ public class NotebookServer extends WebSocketServlet implements
|
|||
|
||||
HashSet<String> userAndRoles = new HashSet<String>();
|
||||
userAndRoles.add(messagereceived.principal);
|
||||
HashSet<String> roles = gson.fromJson(messagereceived.roles,
|
||||
new TypeToken<HashSet<String>>(){}.getType());
|
||||
userAndRoles.addAll(roles);
|
||||
if (!messagereceived.roles.equals("")) {
|
||||
HashSet<String> roles = gson.fromJson(messagereceived.roles,
|
||||
new TypeToken<HashSet<String>>(){}.getType());
|
||||
if (roles != null) {
|
||||
userAndRoles.addAll(roles);
|
||||
}
|
||||
}
|
||||
|
||||
/** Lets be elegant here */
|
||||
switch (messagereceived.op) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue