about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-09-02 09:42:02 +0200
committerGitHub <noreply@github.com>2019-09-02 09:42:02 +0200
commitf9addf4f53453f8c51401bc7171972dc829cee8f (patch)
tree005e0735f33f5b278a25ce717ac13cf33f5ba408
parentc100897c9d349d57927e005a9f1c15606268c728 (diff)
parent8c69d7105b310ba34295cbdcbd4167fac731e649 (diff)
downloadprofani-tty-f9addf4f53453f8c51401bc7171972dc829cee8f.tar.gz
Merge pull request #1183 from profanity-im/issue1153
Don't crash if source jid doesn't contain the node part
-rw-r--r--src/ui/statusbar.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ui/statusbar.c b/src/ui/statusbar.c
index 495b79ab..4ad1e373 100644
--- a/src/ui/statusbar.c
+++ b/src/ui/statusbar.c
@@ -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);