Skip to content

Commit

Permalink
🩹 fix: oops
Browse files Browse the repository at this point in the history
  • Loading branch information
tkr-sh committed Jan 22, 2025
1 parent 45fcb26 commit 7c5d781
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ impl FromLua for char {
match value {
// When integer: reduce it to u8 and try to convert to char
Value::Integer(i) => {
if i <= u8::MAX.into() {
if i <= u8::MAX.into() && i >= 0 {
Ok(char::from(i as u8))
} else {
Err(Error::FromLuaConversionError {
Expand Down

0 comments on commit 7c5d781

Please sign in to comment.