fix crash in region messages.

This commit is contained in:
Enno Rehling 2018-05-20 17:11:29 +02:00
parent b3b19e7c83
commit 226fa2ba08
1 changed files with 5 additions and 4 deletions

View File

@ -723,8 +723,9 @@ rp_messages(struct stream *out, message_list * msgs, faction * viewer, int inden
int k = 0;
struct mlist *m = msgs->begin;
while (m) {
/* messagetype * mt = m->type; */
if (!categorized || strcmp(m->msg->type->section, section) == 0) {
/* categorized messages need a section: */
assert(!categorized || (m->msg->type->section != NULL));
if (!categorized || m->msg->type->section == section) {
char lbuf[8192];
if (!k && categorized) {
@ -2312,11 +2313,11 @@ report_plaintext(const char *filename, report_context * ctx,
message_list *mlist = r_getmessages(r, f);
if (mlist) {
struct mlist **split = merge_messages(mlist, r->msgs);
rp_messages(out, mlist, f, 0, true);
rp_messages(out, mlist, f, 0, false);
split_messages(mlist, split);
}
else {
rp_messages(out, r->msgs, f, 0, true);
rp_messages(out, r->msgs, f, 0, false);
}
}