Skip to content

Commit

Permalink
Fix npub encode error
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowCait committed Oct 16, 2023
1 parent ca235c7 commit 4b16503
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web/src/routes/timeline/Note.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,13 @@
if (displayName !== undefined && displayName !== '') {
return displayName;
}
return nip19.npubEncode(pubkey).substring(0, 'npub1'.length + 7);

try {
return nip19.npubEncode(pubkey).substring(0, 'npub1'.length + 7);
} catch (error) {
console.error('[npub encode error]', pubkey);
return '-';
}
})
.join(' @')}
</span>
Expand Down

0 comments on commit 4b16503

Please sign in to comment.