]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix background refresh being broken when no counter data is sent
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 4 Nov 2010 20:09:13 +0000 (23:09 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 4 Nov 2010 20:09:13 +0000 (23:09 +0300)
functions.js
modules/backend-rpc.php

index 9a1652ce78b40675ed15295be04f70ba10cda29c..c0ba5b349294222005d266608af2326cbef5dca0 100644 (file)
@@ -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();
index 228d45a78eabbdecbb5ae41f54cd30042793f9cf..5ff35b4091a584e8c92a2993bf51dee2e8d6d22d 100644 (file)
 
                        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>";