diff --git a/lib/parser/javascript.js b/lib/parser/javascript.js index dd70cf0987..9acfa1f188 100644 --- a/lib/parser/javascript.js +++ b/lib/parser/javascript.js @@ -125,12 +125,12 @@ ReplyParser.prototype._parseResult = function (type) { for (i = 0; i < packetHeader.size; i++) { ntype = this._buffer[this._offset++]; - if (this._offset === this._buffer.length) { + if (this._offset > this._buffer.length) { throw new Error("too far"); } res = this._parseResult(ntype); if (res === undefined) { - res = null; + res = null; } reply.push(res); }