Commit aa90493f authored by Volker Krause's avatar Volker Krause
Browse files

Stricter coordinate validity check

This seems to happen occasionally as transient state from assigning stuff
from QML. Prevents sending out nonsense queries to backends.
parent 3aa12a43
......@@ -67,7 +67,7 @@ void Location::setCoordinate(float latitude, float longitude)
bool Location::hasCoordinate() const
{
return !std::isnan(d->latitude) && !std::isnan(d->longitude);
return !std::isnan(d->latitude) && !std::isnan(d->longitude) && std::abs(d->latitude) <= 90.0 && std::abs(d->longitude) <= 180.0;
}
bool Location::isEmpty() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment