From 09b8802f51db9406c03cd7411bd1aae1f806d2a1 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Sun, 1 Dec 2019 18:01:28 +0100 Subject: _win_print: Guard against time being null This is encountered when biboumi is used. Example: `/join #debian-next%irc.oftc.net@biboumi.lebihan.pl` It seems then time can be null. g_date_time_format() will not work in this case although time_pref will not be "off". So let's not call g_date_time_format() in this case. But treat it like time is set to off. However message reflection will not work properly with biboumi. Probably we dont get origin-id. Fix https://github.com/profanity-im/profanity/issues/1230 --- src/ui/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui/window.c b/src/ui/window.c index d4495099..12bf40f5 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -1423,7 +1423,7 @@ _win_print(ProfWin *window, const char show_char, int pad_indent, GDateTime *tim } gchar *date_fmt = NULL; - if (g_strcmp0(time_pref, "off") == 0) { + if (g_strcmp0(time_pref, "off") == 0 || time == NULL) { date_fmt = g_strdup(""); } else { date_fmt = g_date_time_format(time, time_pref); -- cgit 1.4.1-2-gfad0