Skip to content

Commit eea4434

Browse files
committed
Updated websocket transport
1 parent 87bce81 commit eea4434

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dop",
3-
"version": "0.22.2",
3+
"version": "0.22.3",
44
"main": "./dist/dop.nodejs.js",
55
"browser": "./dist/dop.js",
66
"unpkg": "./dist/dop.min.js",

src/api/isObjectRegistrable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
dop.isObjectRegistrable = function(object) {
3-
if (!object || typeof object !== "object") return false;
3+
if (object === null || typeof object !== "object") return false;
44
var prototype = Object.getPrototypeOf(object);
55
return prototype === Object.prototype || prototype === Array.prototype;
66
};

src/env/browser/websocket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function websocket(dop, node, options) {
66

77
if (typeof options.url == 'string')
88
url = options.url.replace('http','ws');
9-
else if (typeof window!='undefined' && /http/.test(window.location.href)) {
9+
else if (typeof window!='undefined' && typeof window.location!='undefined' && /http/.test(window.location.href)) {
1010
var domain_prefix = /(ss|ps)?:\/\/([^\/]+)\/?(.+)?/.exec(window.location.href),
1111
protocol = domain_prefix[1] ? 'wss' : 'ws';
1212
url = protocol+'://'+domain_prefix[2].toLocaleLowerCase()+'/'+dop.name;

0 commit comments

Comments
 (0)