Skip to content

Commit

Permalink
Skip invalid plus codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
chmac committed Nov 25, 2024
1 parent 0ac3324 commit 762129c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nr-app/src/components/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 762129c

Please sign in to comment.