nevent author is not mandatory.

This commit is contained in:
fiatjaf 2023-03-26 09:35:42 -03:00
parent 60e01a9006
commit 5a63c75f24
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1
1 changed files with 2 additions and 1 deletions

View File

@ -48,7 +48,8 @@ export function decode(nip19: string): {
let tlv = parseTLV(data)
if (!tlv[0]?.[0]) throw new Error('missing TLV 0 for nevent')
if (tlv[0][0].length !== 32) throw new Error('TLV 0 should be 32 bytes')
if (tlv[2]?.[0].length !== 32) throw new Error('TLV 2 should be 32 bytes')
if (tlv[2] && tlv[2][0].length !== 32)
throw new Error('TLV 2 should be 32 bytes')
return {
type: 'nevent',