From 9e079fe642e985786fce259418bf68448585bec3 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Sun, 16 Dec 2018 15:38:59 +0100 Subject: [PATCH] packed_decoder.js: errorhandling NULL input --- src/TTN/packed_decoder.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/TTN/packed_decoder.js b/src/TTN/packed_decoder.js index 331024d1..c8f319a2 100644 --- a/src/TTN/packed_decoder.js +++ b/src/TTN/packed_decoder.js @@ -5,6 +5,10 @@ function Decoder(bytes, port) { var decoded = {}; + if (bytes.length === 0) { + return {}; + } + if (port === 1) { // only wifi counter data, no gps if (bytes.length === 2) {