From 1e981f4c6d429f5c51cb0d7a5c40fcd78ad236a2 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 17 Feb 2014 18:12:47 +0000 Subject: [PATCH] Don't crash when given a invalid colour, reported by Felix Rosencrantz, fix from Thomas Adam. --- cmd-set-option.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd-set-option.c b/cmd-set-option.c index 046bebd6..9882e449 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -307,11 +307,13 @@ cmd_set_option_set(struct cmd *self, struct cmd_q *cmdq, break; case OPTIONS_TABLE_COLOUR: o = cmd_set_option_colour(self, cmdq, oe, oo, value); - style_update_new(oo, o->name, oe->style); + if (o != NULL) + style_update_new(oo, o->name, oe->style); break; case OPTIONS_TABLE_ATTRIBUTES: o = cmd_set_option_attributes(self, cmdq, oe, oo, value); - style_update_new(oo, o->name, oe->style); + if (o != NULL) + style_update_new(oo, o->name, oe->style); break; case OPTIONS_TABLE_FLAG: o = cmd_set_option_flag(self, cmdq, oe, oo, value);