From 0d640a71ce793cd7c1333599a9d4a2b43e2efebd Mon Sep 17 00:00:00 2001 From: panaaj <38519157+panaaj@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:03:51 +1030 Subject: [PATCH] fix: PGN 129284 to return nextPoint.position = null when there is no / invalid psoition data --- pgns/129284.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pgns/129284.js b/pgns/129284.js index b73b005..710f36f 100644 --- a/pgns/129284.js +++ b/pgns/129284.js @@ -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 } }, {