Closed sergei closed 7 months ago
I presume this piece of code is supposed to take care of it:
let pos = vesselPosition
? new LatLon(vesselPosition.latitude, vesselPosition.longitude)
: null
But was is happening the vesselPosition is not undefined or null, but rather the following object:
{
"longitude": null,
"latitude": null
}
I guess the statement above can be replaced with:
let pos = vesselPosition.latitude && vesselPosition.longitude
? new LatLon(vesselPosition.latitude, vesselPosition.longitude)
: null
but that would be rather swiping the dirt under the rug. I guess the question for SignalK maintainers is if position should be allowed to have lat and lon set to NaN
I don't think it's defined in the spec which is right. So that code should handle either.
But it should be
vesselPossition && vesselPosition.latitude && vesselPosition.longitude
Thanks, I'll do the PR then.
Getting this error if GPS is not available. Although it's not fatal the message pollutes the /var/log/syslog so it would be nice not to have it