mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-17 21:31:57 +01:00
Fixes crash when evaluating the isHex function for an emoji
This commit is contained in:
parent
67106e8a11
commit
08dd634eae
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user