Skip to content

Commit 3c36794

Browse files
Merge pull request #120 from balena-io-modules/fix-map-check
Fix Map existence checks for latitude and longitude
2 parents 5824aaa + d9f04e3 commit 3c36794

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/components/Map/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ const BaseMap = <T extends any>({
131131
click: onItemClick ? () => onItemClick(entry) : undefined,
132132
};
133133

134-
if (!marker.lng || !marker.lat || !marker.id) {
134+
if (
135+
isNaN(Number(marker.lng)) ||
136+
isNaN(Number(marker.lat)) ||
137+
!marker.id
138+
) {
135139
return null;
136140
}
137141

0 commit comments

Comments
 (0)