parser: make sure to not fail synchronously
This commit is contained in:
parent
dfdc69aa3a
commit
3fe7d097ec
@ -52,7 +52,7 @@ Parser.prototype.feed = function feed(data) {
|
||||
|
||||
Parser.prototype.parse = function parse(chunk) {
|
||||
if (this.packet === null) {
|
||||
this.packet = this.parseHeader(chunk);
|
||||
this.packet = this.parseHeader(chunk) || {};
|
||||
} else {
|
||||
this.packet.payload = chunk;
|
||||
if (readU32(utils.checksum(this.packet.payload)) !== this.packet.checksum)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user