Avoids triggering exceptions when the NIP19 parser receives a simple hex key
This commit is contained in:
@@ -19,7 +19,10 @@ object Nip19 {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
val matcher = nip19regex.matcher(uri)
|
val matcher = nip19regex.matcher(uri)
|
||||||
matcher.find()
|
if (!matcher.find()) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
val uriScheme = matcher.group(1) // nostr:
|
val uriScheme = matcher.group(1) // nostr:
|
||||||
val type = matcher.group(2) // npub1
|
val type = matcher.group(2) // npub1
|
||||||
val key = matcher.group(3) // bech32
|
val key = matcher.group(3) // bech32
|
||||||
|
|||||||
Reference in New Issue
Block a user