Skip to content

Commit 7c5d781

Browse files
committed
🩹 fix: oops
1 parent 45fcb26 commit 7c5d781

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/conversion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ impl FromLua for char {
671671
match value {
672672
// When integer: reduce it to u8 and try to convert to char
673673
Value::Integer(i) => {
674-
if i <= u8::MAX.into() {
674+
if i <= u8::MAX.into() && i >= 0 {
675675
Ok(char::from(i as u8))
676676
} else {
677677
Err(Error::FromLuaConversionError {

0 commit comments

Comments
 (0)