mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-19 19:31:43 +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 {
|
||||
tags.filter { it[0] == "p" }.mapNotNull {
|
||||
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()
|
||||
}
|
||||
|
Reference in New Issue
Block a user