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 (#2643)
Browse files Browse the repository at this point in the history
issue introduced in #2467

IFW-851
  • Loading branch information
Haroenv committed Jul 15, 2019
1 parent 0e2486f commit a544231
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 @@ -7,13 +7,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 a544231

Please sign in to comment.