Skip to content
This repository was archived by the owner on Dec 21, 2023. It is now read-only.

Commit 175cd4f

Browse files
authored
Fix an error when file_file_size is nil in tootctl media remove (mastodon#14657)
1 parent 92319d7 commit 175cd4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/mastodon/media_cli.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def remove
3131
processed, aggregate = parallelize_with_progress(MediaAttachment.cached.where.not(remote_url: '').where('created_at < ?', time_ago)) do |media_attachment|
3232
next if media_attachment.file.blank?
3333

34-
size = media_attachment.file_file_size + (media_attachment.thumbnail_file_size || 0)
34+
size = (media_attachment.file_file_size || 0) + (media_attachment.thumbnail_file_size || 0)
3535

3636
unless options[:dry_run]
3737
media_attachment.file.destroy

0 commit comments

Comments
 (0)