Skip to content

Commit

Permalink
fix: PGN 129284 to return nextPoint.position = null when there is no …
Browse files Browse the repository at this point in the history
…/ invalid psoition data
  • Loading branch information
panaaj committed Dec 18, 2024
1 parent a78d3aa commit 0d640a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pgns/129284.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ module.exports = [
'.nextPoint.position'
)
},
allowNull: true,
value: function (n2k) {
return {
const p = {
longitude: Number(n2k.fields['Destination Longitude']),
latitude: Number(n2k.fields['Destination Latitude'])
}
return isNaN(p.latitude) || isNaN(p.longitude) ? null : p
}
},
{
Expand Down

0 comments on commit 0d640a7

Please sign in to comment.