From 1ff03fcf2870852522bde02c9d2335c6e8ae1d49 Mon Sep 17 00:00:00 2001 From: Can Yucel Date: Wed, 11 Feb 2015 13:00:29 -0800 Subject: [PATCH] add defensive response check in subscription fail callback --- core/pubnub-common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pubnub-common.js b/core/pubnub-common.js index 3da57696b..42f8a230c 100644 --- a/core/pubnub-common.js +++ b/core/pubnub-common.js @@ -1299,7 +1299,7 @@ function PN_API(setup) { timeout : sub_timeout, callback : jsonp, fail : function(response) { - if (response['error'] && response['service']) { + if (response && response['error'] && response['service']) { _invoke_error(response, errcb); _test_connection(1); } else {