From 762129c4a7861c3c1b41565663c05a2e3ec8292e Mon Sep 17 00:00:00 2001 From: Callum Macdonald Date: Mon, 25 Nov 2024 12:00:17 +0000 Subject: [PATCH] Skip invalid plus codes. --- nr-app/src/components/Map.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nr-app/src/components/Map.tsx b/nr-app/src/components/Map.tsx index f938e6c..da2f893 100644 --- a/nr-app/src/components/Map.tsx +++ b/nr-app/src/components/Map.tsx @@ -30,6 +30,7 @@ import { MAP_LAYER_KEY, MAP_LAYERS, MapLayer } from "@common/constants"; import { getFirstLabelValueFromEvent, getFirstTagValueFromEvent, + isPlusCode, } from "@common/utils"; import { createSelector } from "@reduxjs/toolkit"; import { matchFilter, NostrEvent } from "nostr-tools"; @@ -93,7 +94,11 @@ const NoteMarker = ({ "open-location-code", ); - if (typeof plusCode === "undefined") { + if (typeof plusCode === "undefined" || !isPlusCode(plusCode)) { + console.warn( + "#9k8qKM skipping event with missing / invalid plusCode", + event, + ); return null; }