Protects against empty nip04 content

This commit is contained in:
Vitor Pamplona 2024-08-28 17:59:59 -04:00
parent b5709f9527
commit 8be74649ce

View File

@ -154,6 +154,7 @@ class Nip04(
fun isNIP04(encoded: String): Boolean {
val l = encoded.length
if (l < 28) return false
return encoded[l - 28] == '?' && encoded[l - 27] == 'i' && encoded[l - 26] == 'v' && encoded[l - 25] == '='
}