packed_decoder.js: errorhandling NULL input
This commit is contained in:
parent
74ac3f8525
commit
9e079fe642
@ -5,6 +5,10 @@ function Decoder(bytes, port) {
|
|||||||
|
|
||||||
var decoded = {};
|
var decoded = {};
|
||||||
|
|
||||||
|
if (bytes.length === 0) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
if (port === 1) {
|
if (port === 1) {
|
||||||
// only wifi counter data, no gps
|
// only wifi counter data, no gps
|
||||||
if (bytes.length === 2) {
|
if (bytes.length === 2) {
|
||||||
|
Loading…
Reference in New Issue
Block a user