From d255a2a0506e56c23344011facc6f8f1f799656e Mon Sep 17 00:00:00 2001 From: nibon7 Date: Fri, 5 Aug 2022 19:30:44 +0800 Subject: [PATCH] Fix color parsing (#6234) Signed-off-by: nibon7 --- crates/nu-color-config/src/nu_style.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/nu-color-config/src/nu_style.rs b/crates/nu-color-config/src/nu_style.rs index e3b21095e3..24eace4876 100644 --- a/crates/nu-color-config/src/nu_style.rs +++ b/crates/nu-color-config/src/nu_style.rs @@ -11,12 +11,12 @@ pub struct NuStyle { pub fn parse_nustyle(nu_style: NuStyle) -> Style { // get the nu_ansi_term::Color foreground color let fg_color = match nu_style.fg { - Some(fg) => color_from_hex(&fg).expect("error with foreground color"), + Some(fg) => color_from_hex(&fg).unwrap_or_default(), _ => None, }; // get the nu_ansi_term::Color background color let bg_color = match nu_style.bg { - Some(bg) => color_from_hex(&bg).expect("error with background color"), + Some(bg) => color_from_hex(&bg).unwrap_or_default(), _ => None, }; // get the attributes