diff --git a/app/helpers/db/searchRequest.js b/app/helpers/db/searchRequest.js index a136915..08e8922 100644 --- a/app/helpers/db/searchRequest.js +++ b/app/helpers/db/searchRequest.js @@ -21,6 +21,10 @@ const findSearchRequestsForRealEstate = async realEstate => { locationLong } = realEstate; + if (!locationLat || !locationLong) { + return []; + } + const stGeometry = sequelize.fn( "ST_GEOMFROMTEXT", `POINT (${locationLong} ${locationLat})`,