From df086209a281a37c0eb04d737e9d328aaa79b473 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 5 Mar 2020 15:56:01 +0100 Subject: [PATCH] Fix "tootctl media remove-orphans" crashing when encountering invalid media (#13170) Fixes #13168 --- app/models/media_attachment.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 42364641f3..1e36625ca9 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