summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-04 23:09:13 +0300
committerAndrew Dolgov <[email protected]>2010-11-04 23:09:13 +0300
commita8f447f3985f483588ea8d6e9a0c081e2def6af8 (patch)
treefcca9a4d7b1e0fdbab48d25ba12c5959d49e8a21
parent6a7817c1ad684ea6eb0b02180e6d2040b3cb0a77 (diff)
fix background refresh being broken when no counter data is sent
-rw-r--r--functions.js6
-rw-r--r--modules/backend-rpc.php6
2 files changed, 6 insertions, 6 deletions
diff --git a/functions.js b/functions.js
index 9a1652ce7..c0ba5b349 100644
--- a/functions.js
+++ b/functions.js
@@ -562,11 +562,13 @@ function parse_counters_reply(transport, scheduled_call) {
var counters = reply.getElementsByTagName("counters")[0];
- parse_counters(counters, scheduled_call);
+ if (counters)
+ parse_counters(counters, scheduled_call);
var runtime_info = reply.getElementsByTagName("runtime-info")[0];
- parse_runtime_info(runtime_info);
+ if (runtime_info)
+ parse_runtime_info(runtime_info);
if (feedsSortByUnread()) {
resort_feedlist();
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index 228d45a78..5ff35b409 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -293,15 +293,13 @@
print "<rpc-reply>";
- print "<counters><![CDATA[";
-
if ($global_unread_caller != $global_unread) {
+ print "<counters><![CDATA[";
$omode = $_REQUEST["omode"];
print json_encode(getAllCounters($link, $omode));
+ print "]]></counters>";
}
- print "]]></counters>";
-
print_runtime_info($link);
print "</rpc-reply>";