summaryrefslogtreecommitdiff
path: root/app/models/diff_viewer/image.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/diff_viewer/image.rb')
-rw-r--r--app/models/diff_viewer/image.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/diff_viewer/image.rb b/app/models/diff_viewer/image.rb
index 62a3446a7b6..fca6c664196 100644
--- a/app/models/diff_viewer/image.rb
+++ b/app/models/diff_viewer/image.rb
@@ -10,5 +10,13 @@ module DiffViewer
self.binary = true
self.switcher_icon = 'doc-image'
self.switcher_title = _('image diff')
+
+ def self.can_render?(diff_file, verify_binary: true)
+ # When both blobs are missing, we often still have a textual diff that can
+ # be displayed
+ return false if diff_file.old_blob.nil? && diff_file.new_blob.nil?
+
+ super
+ end
end
end