Skip to content

Commit 2f31a4e

Browse files
[fix] Ensure globals are functions before running instanceof (#68)
Following socketio/has-binary#4.
1 parent 8e5465d commit 2f31a4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

binary.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ exports.removeBlobs = function(data, callback) {
9797
if (!obj) return obj;
9898

9999
// convert any blob
100-
if ((global.Blob && obj instanceof Blob) ||
101-
(global.File && obj instanceof File)) {
100+
if ((typeof global.Blob === 'function' && obj instanceof Blob) ||
101+
(typeof global.File === 'function' && obj instanceof File)) {
102102
pendingBlobs++;
103103

104104
// async filereader

0 commit comments

Comments
 (0)