mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 23:46:23 +02:00
Doesn't crash when a non-hex key is inserted in the contact list
This commit is contained in:
@@ -23,7 +23,12 @@ class ContactListEvent(
|
|||||||
val verifiedFollowKeySet: Set<HexKey> by lazy {
|
val verifiedFollowKeySet: Set<HexKey> by lazy {
|
||||||
tags.filter { it[0] == "p" }.mapNotNull {
|
tags.filter { it[0] == "p" }.mapNotNull {
|
||||||
it.getOrNull(1)?.let { unverifiedHex: String ->
|
it.getOrNull(1)?.let { unverifiedHex: String ->
|
||||||
decodePublicKey(unverifiedHex).toHexKey()
|
try {
|
||||||
|
decodePublicKey(unverifiedHex).toHexKey()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w("ContactListEvent", "Can't parse tags as a follows: ${it[1]}", e)
|
||||||
|
null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}.toSet()
|
}.toSet()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user