From: Eugen Rochko Date: Thu, 5 Mar 2020 14:56:01 +0000 (+0100) Subject: Fix "tootctl media remove-orphans" crashing when encountering invalid media (#13170) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=d081a80cff8e53a0ff48fb4274bc615166478b40;p=mastodon.git Fix "tootctl media remove-orphans" crashing when encountering invalid media (#13170) Fixes #13168 --- diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 42364641f..1e36625ca 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -170,6 +170,7 @@ class MediaAttachment < ApplicationRecord def variant?(other_file_name) return true if file_file_name == other_file_name + return false if file_file_name.nil? formats = file.styles.values.map(&:format).compact