mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
fix panic in azalea-chat
This commit is contained in:
parent
2a2169226f
commit
bc7e0ab537
1 changed files with 1 additions and 1 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Reference in a new issue