Skip to content

Commit

Permalink
fix: ignore null positions
Browse files Browse the repository at this point in the history
Fixes #100.
  • Loading branch information
tkurki committed Sep 25, 2023
1 parent c85a752 commit ce39f5d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions sentences/GLL.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ module.exports = function (app) {
var hours = ('00' + datetime.getHours()).slice(-2)
var minutes = ('00' + datetime.getMinutes()).slice(-2)
var seconds = ('00' + datetime.getSeconds()).slice(-2)
return nmea.toSentence([
'$GPGLL',
nmea.toNmeaDegreesLatitude(position.latitude),
nmea.toNmeaDegreesLongitude(position.longitude),
hours + minutes + seconds + '.020',
'A'
])
if (position !== null) {
return nmea.toSentence([
'$GPGLL',
nmea.toNmeaDegreesLatitude(position.latitude),
nmea.toNmeaDegreesLongitude(position.longitude),
hours + minutes + seconds + '.020',
'A'
])
}
}
}
}

0 comments on commit ce39f5d

Please sign in to comment.