-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Milestone
Description
Bjorn Harvold opened DATAMONGO-1361 and commented
I found that if I a run a geoNear query with an accompanying search query that doesn't return any results, I encounter an NPE here.
java.lang.NullPointerException
at org.springframework.data.mongodb.core.MongoTemplate.geoNear(MongoTemplate.java:667)
at org.springframework.data.mongodb.core.MongoTemplate.geoNear(MongoTemplate.java:618)
Example document:
{
"id": "1",
"available": false,
"location": {
"type": "Point",
"coordinates": [
40.758934,
-73.992514
]
}
}
if the query looks like this:
NearQuery q = NearQuery.near(point).maxDistance(new Distance(maxDistance, Metrics.KILOMETERS));
q.query(where("available").is(true));
You get the NPE. Let me know if you need more information from me
Affects: 1.8.2 (Gosling SR2)
Referenced from: commits 160de0a, 2949908, 8ddbc3c
Backported to: 1.8.4 (Gosling SR4), 1.7.3 (Fowler SR3)