Merge pull request #1183 from profanity-im/issue1153

Don't crash if source jid doesn't contain the node part
This commit is contained in:
Michael Vetter
2019-09-02 09:42:02 +02:00
committed by GitHub

View File

@@ -198,7 +198,9 @@ _create_tab(const int win, win_type_t wintype, char *identifier, gboolean highli
char *pref = prefs_get_string(PREF_STATUSBAR_CHAT);
if (g_strcmp0("user", pref) == 0) {
Jid *jidp = jid_create(tab->identifier);
tab->display_name = strdup(jidp->localpart);
tab->display_name = jidp->localpart != NULL ?
strdup(jidp->localpart) :
strdup(jidp->barejid);
jid_destroy(jidp);
} else {
tab->display_name = strdup(tab->identifier);