Skip to content

Commit f7defd3

Browse files
AlexCodesAppslpil
authored andcommitted
fix string.utf_codepoint
1 parent 1a274af commit f7defd3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/gleam/string.gleam

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,7 @@ pub fn utf_codepoint(value: Int) -> Result(UtfCodepoint, Nil) {
811811
i if i > 1_114_111 -> Error(Nil)
812812
65_534 | 65_535 -> Error(Nil)
813813
i if i >= 55_296 && i <= 57_343 -> Error(Nil)
814+
i if i < 0 -> Error(Nil)
814815
i -> Ok(unsafe_int_to_utf_codepoint(i))
815816
}
816817
}

0 commit comments

Comments
 (0)