Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
fix(geo): check for undefined in isEqual
Browse files Browse the repository at this point in the history
issue introduced in #2467

IFW-851
  • Loading branch information
Haroenv committed Jul 9, 2019
1 parent 6ef1585 commit 8453ac9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/react-instantsearch-dom-maps/src/Connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@ function isEqualPosition(a, b) {
if (a === b) {
return true;
}
if (a === undefined || b === undefined) {
return false;
}

return a.lat === b.lat && a.lng === b.lng;
}

function isEqualCurrentRefinement(a, b) {
if (a === b) {
return true;
}

if (a === undefined || b === undefined) {
return false;
}

return (
isEqualPosition(a.northEast, b.northEast) &&
isEqualPosition(a.southWest, b.southWest)
Expand Down

0 comments on commit 8453ac9

Please sign in to comment.