Skip to content

Commit 5968753

Browse files
authored
Only call marker on press when coordinate is defined (#893)
1 parent e686cff commit 5968753

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/maps/src/components/MapMarker.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ export function renderMarker(
9393
onPress={(event) => {
9494
onMarkerPress?.();
9595
const coordinate = event.nativeEvent.coordinate;
96-
onPress?.(coordinate.latitude, coordinate.longitude);
96+
if (coordinate) {
97+
onPress?.(coordinate.latitude, coordinate.longitude);
98+
}
9799
}}
98100
icon={
99101
shouldUseDefaultIconImplementation

0 commit comments

Comments
 (0)