Skip to content

Commit

Permalink
fix early return error (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
thoomasbro authored Mar 17, 2023
2 parents 1e977db + b2d33ca commit 6bfdd37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/features/LocateOnMap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export function LocateOnMap() {
const options = results.map(r => ({ label: r.label, value: r.value })) as any

const handleSelectLocation = async placeId => {
if (!placeId) {
const originalResult = results.find(r => r.value === placeId)
if (!originalResult) {
return
}
const originalResult = results.find(r => r.value === placeId)
const boundingBox = await getPlaceCoordinates(originalResult?.placeId)
if (boundingBox) {
dispatch(setFitToExtent(transformExtent(boundingBox, WSG84_PROJECTION, OPENLAYERS_PROJECTION)))
Expand Down

0 comments on commit 6bfdd37

Please sign in to comment.