Skip to content

Commit c88f4b6

Browse files
committed
Modified ArrayBuffer check for browser hashes to prevent Invalid Variable error in older browsers
1 parent e1fd848 commit c88f4b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ var util = {
469469
var sliceFn = util.arraySliceFn(data);
470470
var isBuffer = Buffer.isBuffer(data);
471471
//Identifying objects with an ArrayBuffer as buffers
472-
if (util.isBrowser() && ArrayBuffer && data && data.buffer instanceof ArrayBuffer) isBuffer = true;
472+
if (util.isBrowser() && typeof ArrayBuffer !== 'undefined' && data && data.buffer instanceof ArrayBuffer) isBuffer = true;
473473

474474
if (callback && typeof data === 'object' &&
475475
typeof data.on === 'function' && !isBuffer) {

0 commit comments

Comments
 (0)