mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-07-12 18:12:19 +02:00
Fixes crash when evaluating the isHex function for an emoji
This commit is contained in:
@ -42,8 +42,13 @@ object Hex {
|
||||
if (hex.isEmpty()) return false
|
||||
if (hex.length and 1 != 0) return false // must be even
|
||||
|
||||
for (c in hex.indices) {
|
||||
if (hexToByte[hex[c].code] < 0) return false
|
||||
try {
|
||||
for (c in hex.indices) {
|
||||
if (hexToByte[hex[c].code] < 0) return false
|
||||
}
|
||||
} catch (e: IllegalArgumentException) {
|
||||
// there are p tags with emoji's which makes the hex[c].code > 256
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
|
Reference in New Issue
Block a user