diff --git a/src/bevent.c b/src/bevent.c index 72a0c6b41..56c1755cd 100644 --- a/src/bevent.c +++ b/src/bevent.c @@ -506,8 +506,10 @@ int odict_encode_bevent(struct odict *od, struct bevent *event) if (hdr) err = odict_pl_add(od, "contact", &hdr->val); - err |= odict_pl_add(od, "display", &msg->from.dname); - err |= re_sdprintf(&buf, "%H", uri_encode, &msg->from.uri); + if (pl_isset(&msg->from.dname)) + odict_pl_add(od, "display", &msg->from.dname); + + err = re_sdprintf(&buf, "%H", uri_encode, &msg->from.uri); err |= odict_entry_add(od, "from", ODICT_STRING, buf); mem_deref(buf); if (err)