damus.io

damus.io website
git clone git://jb55.com/damus.io
Log | Files | Refs | README

commit be580e023468e88d502d49bd95116995fc573260
parent c0f612e2d3ae551bb931e76d3227d1506d875696
Author: William Casarin <jb55@jb55.com>
Date:   Fri, 11 Nov 2022 12:43:55 -0800

web: wrap profile parsing with try/catch

dont let nerds crash our app

Diffstat:
Mweb/damus.js | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/web/damus.js b/web/damus.js @@ -333,7 +333,11 @@ function process_profile_event(model, ev) { } model.profile_events[ev.pubkey] = ev - model.profiles[ev.pubkey] = JSON.parse(ev.content) + try { + model.profiles[ev.pubkey] = JSON.parse(ev.content) + } catch(e) { + log_debug("failed to parse profile contents", ev) + } } function send_initial_filters(account_id, pubkey, relay) {