]> cat aescling's git repositories - mastodon.git/commitdiff
Fix `tootctl domains crawl` with JSON format output crash (#9820)
authorEugen Rochko <eugen@zeonfederated.com>
Wed, 16 Jan 2019 14:47:55 +0000 (15:47 +0100)
committerGitHub <noreply@github.com>
Wed, 16 Jan 2019 14:47:55 +0000 (15:47 +0100)
Fix #9817

lib/mastodon/domains_cli.rb

index be68ae84b9fd1e483980f14d5b686bfbfe350e10..303b8a94a0f0be6cf5eaaed54dcb2421375152fb 100644 (file)
@@ -140,15 +140,8 @@ module Mastodon
     end
 
     def stats_to_json(stats)
-      totals.each_key do |domain|
-        if totals[domain].is_a?(Hash)
-          totals[domain]['activity'] = stats[domain]
-        else
-          totals.delete(domain)
-        end
-      end
-
-      say(Oj.dump(totals))
+      stats.compact!
+      say(Oj.dump(stats))
     end
   end
 end