Skip to content

Commit

Permalink
_win_print: Guard against time being null
Browse files Browse the repository at this point in the history
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 #1230
  • Loading branch information
jubalh committed Dec 1, 2019
1 parent f0a719d commit 09b8802
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 09b8802

Please sign in to comment.