diff --git a/decode/ethernet_packet.js b/decode/ethernet_packet.js index 43afcc5..ff12432 100644 --- a/decode/ethernet_packet.js +++ b/decode/ethernet_packet.js @@ -80,7 +80,11 @@ EthernetPacket.prototype.toString = function () { default: ret += " ethertype " + this.ethertype; } - return ret + " " + this.payload.toString(); + var payload = ''; + if (this.payload !== null) { + payload = this.payload.toString(); + } + return ret + " " + payload; }; module.exports = EthernetPacket;