about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2020-08-25 01:09:46 +0900
committerGitHub <noreply@github.com>2020-08-24 18:09:46 +0200
commit175cd4f8efb62abf8ba7b758b21b724798deaaa5 (patch)
tree490eeeb04f2a1e8a55b1c74b70fe4a42dbff2c8a /lib
parent92319d73409a02689e05ae491a15ce81003a7b7e (diff)
Fix an error when file_file_size is nil in tootctl media remove (#14657)
Diffstat (limited to 'lib')
-rw-r--r--lib/mastodon/media_cli.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mastodon/media_cli.rb b/lib/mastodon/media_cli.rb
index 7b82c3d22..54da5b2cd 100644
--- a/lib/mastodon/media_cli.rb
+++ b/lib/mastodon/media_cli.rb
@@ -31,7 +31,7 @@ module Mastodon
       processed, aggregate = parallelize_with_progress(MediaAttachment.cached.where.not(remote_url: '').where('created_at < ?', time_ago)) do |media_attachment|
         next if media_attachment.file.blank?
 
-        size = media_attachment.file_file_size + (media_attachment.thumbnail_file_size || 0)
+        size = (media_attachment.file_file_size || 0) + (media_attachment.thumbnail_file_size || 0)
 
         unless options[:dry_run]
           media_attachment.file.destroy