articles_callback: do not try to extract counters when transport.responseXML is MIA

This commit is contained in:
Andrew Dolgov 2009-02-02 15:58:24 +03:00
parent 5d3a3ce7a9
commit d63170bff0
1 changed files with 9 additions and 7 deletions

View File

@ -362,14 +362,16 @@ function article_callback2(transport, id, feed_id) {
setTimeout('updateFeedList(false, false)', 50); setTimeout('updateFeedList(false, false)', 50);
_reload_feedlist_after_view = false; _reload_feedlist_after_view = false;
} else { } else {
var counters = transport.responseXML.getElementsByTagName("counters")[0]; if (transport.responseXML) {
var counters = transport.responseXML.getElementsByTagName("counters")[0];
if (counters) { if (counters) {
debug("parsing piggybacked counters: " + counters); debug("parsing piggybacked counters: " + counters);
parse_counters(counters, false); parse_counters(counters, false);
} else { } else {
debug("counters container not found in reply, requesting..."); debug("counters container not found in reply, requesting...");
request_counters(); request_counters();
}
} }
} }