From b4ac8b949e04f4a6c6e48baaab2beeb7105e57d5 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 22 Sep 2008 21:55:14 +0000 Subject: [PATCH] More explicit error when responseXML is null --- chrome/content/zotero/xpcom/sync.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js index bc5bc53444..4bdb914279 100644 --- a/chrome/content/zotero/xpcom/sync.js +++ b/chrome/content/zotero/xpcom/sync.js @@ -1202,14 +1202,18 @@ Zotero.Sync.Server = new function () { function _checkResponse(xmlhttp) { - if (!xmlhttp.responseXML || - !xmlhttp.responseXML.childNodes[0] || + if (!xmlhttp.responseXML) { + _error('Empty response from server'); + } + + if ( !xmlhttp.responseXML.childNodes[0] || xmlhttp.responseXML.childNodes[0].tagName != 'response') { Zotero.debug(xmlhttp.responseText); _error('Invalid response from server', xmlhttp.responseText); } if (!xmlhttp.responseXML.childNodes[0].firstChild) { + Zotero.debug(xmlhttp.responseText); _error('Empty response from server'); } }