aboutsummaryrefslogtreecommitdiff
path: root/azalea-chat/src/component.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2026-01-11 23:01:30 -1030
committermat <git@matdoes.dev>2026-01-11 23:01:30 -1030
commit736edae2ad243f6eb3e7b01ca9b6266745cdeb24 (patch)
tree3d1ae581c5a1addca1ac48febb59a29de0fb180b /azalea-chat/src/component.rs
parent1accbac964168af5fa0d87cb170389f0a9d01363 (diff)
downloadazalea-drasl-736edae2ad243f6eb3e7b01ca9b6266745cdeb24.tar.xz
add fuzzer for azalea-protocol and fix a few panics
Diffstat (limited to 'azalea-chat/src/component.rs')
-rw-r--r--azalea-chat/src/component.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/azalea-chat/src/component.rs b/azalea-chat/src/component.rs
index 637aafc7..c64ee559 100644
--- a/azalea-chat/src/component.rs
+++ b/azalea-chat/src/component.rs
@@ -408,6 +408,9 @@ impl<'de> Deserialize<'de> for FormattedText {
));
}
let json_array = json.as_array().unwrap();
+ if json_array.is_empty() {
+ return Ok(FormattedText::default());
+ }
// the first item in the array is the one that we're gonna return, the others
// are siblings
let mut component =