From bc7e0ab53739f59f68f860ba75973908ffc5b560 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 28 May 2023 14:05:23 -0500 Subject: [PATCH] fix panic in azalea-chat --- azalea-chat/src/style.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azalea-chat/src/style.rs b/azalea-chat/src/style.rs index 4b424f31..9c0d645e 100755 --- a/azalea-chat/src/style.rs +++ b/azalea-chat/src/style.rs @@ -29,7 +29,7 @@ impl TextColor { pub fn parse(value: String) -> Option { if value.starts_with('#') { let n = value.chars().skip(1).collect::(); - let n = u32::from_str_radix(&n, 16).unwrap(); + let n = u32::from_str_radix(&n, 16).ok()?; return Some(TextColor::from_rgb(n)); } let color_option = NAMED_COLORS.get(&value.to_ascii_uppercase());