diff --git a/n2kMapper.js b/n2kMapper.js index 6f2bfa3..e82f027 100644 --- a/n2kMapper.js +++ b/n2kMapper.js @@ -190,8 +190,8 @@ var toDelta = function (n2k, state, customPgns = {}) { //filter out invalid mmsi let last = result.context.lastIndexOf(':') if ( last != -1 && result.context.slice(last+1).length < 9 ) { - console.log('BAD: ' + result.context) - result.updates = [] + console.error('bad MMSI: ' + result.context) + return } } diff --git a/test/129038_ais_class_a.js b/test/129038_ais_class_a.js index c6f7629..19dfbe4 100644 --- a/test/129038_ais_class_a.js +++ b/test/129038_ais_class_a.js @@ -80,7 +80,8 @@ describe('129038 Class A Update', function () { "description": "AIS Class A Position Report", "timestamp": "2022-05-09T13:38:38.917Z" } - mapper.toDelta(msg, {}).updates.length.should.equal(0) + const deltaType = typeof mapper.toDelta(msg, {}) + deltaType.should.equal('undefined') }) })