mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-28 18:51:45 +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.isEmpty()) return false
|
||||||
if (hex.length and 1 != 0) return false // must be even
|
if (hex.length and 1 != 0) return false // must be even
|
||||||
|
|
||||||
for (c in hex.indices) {
|
try {
|
||||||
if (hexToByte[hex[c].code] < 0) return false
|
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
|
return true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user