Fix NPE if a participant hasn't message in an individual topic
This commit is contained in:
parent
e6f67154d1
commit
3bb095bef8
@ -31,4 +31,8 @@ public class IndividualTopic extends Topic {
|
||||
public List<Message> getMessages(final String author) {
|
||||
return this.messages.get(author);
|
||||
}
|
||||
|
||||
public boolean hasParticipant(final String participant) {
|
||||
return this.messages.containsKey(participant);
|
||||
}
|
||||
}
|
||||
|
@ -56,11 +56,14 @@ public class Meeting {
|
||||
buffer.append(getLine(
|
||||
Meeting.USER_SERVICE.getRealName(participant), '-'));
|
||||
for (final IndividualTopic topic : this.individualTopics) {
|
||||
buffer.append("\n");
|
||||
buffer.append(getTopic(topic));
|
||||
buffer.append("\n");
|
||||
for (final Message message : topic.getMessages(participant)) {
|
||||
buffer.append("* " + message.getContent() + "\n");
|
||||
if (topic.hasParticipant(participant)) {
|
||||
buffer.append("\n");
|
||||
buffer.append(getTopic(topic));
|
||||
buffer.append("\n");
|
||||
for (final Message message : topic
|
||||
.getMessages(participant)) {
|
||||
buffer.append("* " + message.getContent() + "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user