Permalink
Browse files

Check for window.OpenAjax before trying to get the hub.

Only send messages to the hub if it exists.

close #477
  • Loading branch information...
1 parent 469d624 commit 7e762751e8f6cb6a2fd3c425aceacb600d397461 @shane-tomlinson shane-tomlinson committed Oct 25, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 browserid/static/dialog/resources/network.js
View
4 browserid/static/dialog/resources/network.js
@@ -42,7 +42,7 @@ BrowserID.Network = (function() {
xhr = $,
server_time,
auth_status,
- hub = OpenAjax.hub;
+ hub = window.OpenAjax && OpenAjax.hub;
function deferResponse(cb) {
if (cb) {
@@ -58,7 +58,7 @@ BrowserID.Network = (function() {
function xhrError(cb, errorMessage) {
return function() {
if (cb) cb();
- hub.publish("xhrError", errorMessage);
+ hub && hub.publish("xhrError", errorMessage);
};
}

0 comments on commit 7e76275

Please sign in to comment.