diff options
| author | mat <git@matdoes.dev> | 2023-05-28 14:05:23 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-05-28 14:05:23 -0500 |
| commit | bc7e0ab53739f59f68f860ba75973908ffc5b560 (patch) | |
| tree | 3c8808c31ed1064d2db82a0dabc95b04233bffdf | |
| parent | 2a2169226fb112082d91e8fca918c82cb47db7ef (diff) | |
| download | azalea-drasl-bc7e0ab53739f59f68f860ba75973908ffc5b560.tar.xz | |
fix panic in azalea-chat
| -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()); |
