Skip to content

Commit

Permalink
Fix issue #202 - Exception thrown when type @ to mention user
Browse files Browse the repository at this point in the history
  • Loading branch information
robinshine committed Aug 23, 2020
1 parent f7ec932 commit a5c6059
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions server-core/src/main/java/io/onedev/server/model/Issue.java
Original file line number Diff line number Diff line change
Expand Up @@ -568,13 +568,17 @@ public Collection<User> getParticipants() {
UserManager userManager = OneDev.getInstance(UserManager.class);
for (IssueField field: getFields()) {
if (field.getType().equals(InputSpec.USER)) {
User user = userManager.findByName(field.getValue());
if (user != null)
participants.add(user);
if (field.getValue() != null) {
User user = userManager.findByName(field.getValue());
if (user != null)
participants.add(user);
}
} else if (field.getType().equals(InputSpec.GROUP)) {
Group group = OneDev.getInstance(GroupManager.class).find(field.getValue());
if (group != null)
participants.addAll(group.getMembers());
if (field.getValue() != null) {
Group group = OneDev.getInstance(GroupManager.class).find(field.getValue());
if (group != null)
participants.addAll(group.getMembers());
}
}
}
for (IssueComment comment: getComments()) {
Expand Down

0 comments on commit a5c6059

Please sign in to comment.