Skip to content

Commit

Permalink
Fix an error when file_file_size is nil in tootctl media remove (mast…
Browse files Browse the repository at this point in the history
  • Loading branch information
noellabo authored and Mage committed Jan 14, 2022
1 parent 4613926 commit 636d850
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mastodon/media_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def remove
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
Expand Down

0 comments on commit 636d850

Please sign in to comment.