Skip to content

Commit

Permalink
Merge pull request #120 from balena-io-modules/fix-map-check
Browse files Browse the repository at this point in the history
Fix Map existence checks for latitude and longitude
  • Loading branch information
flowzone-app[bot] authored Oct 7, 2024
2 parents 5824aaa + d9f04e3 commit 3c36794
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ const BaseMap = <T extends any>({
click: onItemClick ? () => onItemClick(entry) : undefined,
};

if (!marker.lng || !marker.lat || !marker.id) {
if (
isNaN(Number(marker.lng)) ||
isNaN(Number(marker.lat)) ||
!marker.id
) {
return null;
}

Expand Down

0 comments on commit 3c36794

Please sign in to comment.