about summary refs log tree commit diff
path: root/lib/mastodon/domains_cli.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-01-16 15:47:55 +0100
committerGitHub <noreply@github.com>2019-01-16 15:47:55 +0100
commit59e3a7f87bd7d855774ef8caa1a7d795059251fc (patch)
tree523d98ed57a2cb67d695e74097798a5bfbd1a676 /lib/mastodon/domains_cli.rb
parenta4f07bad9529a6bebb6a0292c4ef0bfc6e29c4d2 (diff)
Fix `tootctl domains crawl` with JSON format output crash (#9820)
Fix #9817
Diffstat (limited to 'lib/mastodon/domains_cli.rb')
-rw-r--r--lib/mastodon/domains_cli.rb11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/mastodon/domains_cli.rb b/lib/mastodon/domains_cli.rb
index be68ae84b..303b8a94a 100644
--- a/lib/mastodon/domains_cli.rb
+++ b/lib/mastodon/domains_cli.rb
@@ -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