From f1fc0916ef6dc59cc4498cce32d86b40b0dbe947 Mon Sep 17 00:00:00 2001
From: Arnaud Levy <arnaud.levy@noesya.coop>
Date: Wed, 12 Jun 2024 15:06:29 +0200
Subject: [PATCH] Fix #1669 (#2018)

---
 app/models/communication/website/git_file.rb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/app/models/communication/website/git_file.rb b/app/models/communication/website/git_file.rb
index f147b220e..de321a427 100644
--- a/app/models/communication/website/git_file.rb
+++ b/app/models/communication/website/git_file.rb
@@ -75,7 +75,12 @@ class Communication::Website::GitFile < ApplicationRecord
 
   def self.analyze_if_blob(object)
     return unless object.is_a? ActiveStorage::Blob
-    object.analyze unless object.analyzed?
+    begin
+      object.analyze unless object.analyzed?
+    rescue
+      # https://github.com/osunyorg/admin/issues/1669
+      puts "Blob #{object} crashed during analysis"
+    end
   end
 
   def template_static
-- 
GitLab