Skip to content

Commit 3b279f6

Browse files
committed
unly monkey-patch MockBuffer property if it's a function
1 parent c487f54 commit 3b279f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/packets/packet.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,9 @@ Packet.MockBuffer = function () {
684684
var noop = function () {};
685685
var res = Buffer(0);
686686
for (var op in Buffer.prototype) {
687-
res[op] = noop;
687+
if (typeof res[op] == 'function') {
688+
res[op] = noop;
689+
}
688690
}
689691
return res;
690692
};

0 commit comments

Comments
 (0)