From fd36fcdb1ee78a5aa1a84bc42d32ceeb3653783c Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 12 Dec 2019 20:16:10 +0100 Subject: [PATCH] Handle case where color.nick is not set Fixes a segfault if color.nick was never set but we want to print it's value. --- src/ui/console.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ui/console.c b/src/ui/console.c index 91b499f7..28381ba9 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -1973,6 +1973,11 @@ cons_color_setting(void) { char *color_pref = prefs_get_string(PREF_COLOR_NICK); + if (!color_pref) { + cons_show("Consistent color generation for nicks (/color) : OFF"); + return; + } + if (strcmp(color_pref, "true") == 0) { cons_show("Consistent color generation for nicks (/color) : ON"); } else if (strcmp(color_pref, "redgreen") == 0) {