aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--azalea-buf/src/read.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/azalea-buf/src/read.rs b/azalea-buf/src/read.rs
index 9ed416b9..045dcd4f 100644
--- a/azalea-buf/src/read.rs
+++ b/azalea-buf/src/read.rs
@@ -48,7 +48,7 @@ fn read_utf_with_len(buf: &mut impl Read, max_length: u32) -> Result<String, Buf
let mut buffer = vec![0; length as usize];
buf.read_exact(&mut buffer)
.map_err(|_| BufReadError::InvalidUtf8)?;
- string.push_str(std::str::from_utf8(&buffer).unwrap());
+ string.push_str(std::str::from_utf8(&buffer).map_err(|_| BufReadError::InvalidUtf8)?);
if string.len() > length as usize {
return Err(BufReadError::StringLengthTooLong { length, max_length });
}