diff options
| -rwxr-xr-x | azalea-chat/src/style.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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<TextColor> { if value.starts_with('#') { let n = value.chars().skip(1).collect::<String>(); - 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()); |
