From 05e66b60ee1b198abdc14b120ed8b707ff62b67f Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Mon, 1 Apr 2024 13:09:35 +0300 Subject: [PATCH] fix result generation with annots --- lib/submissions/generate_result_attachments.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/submissions/generate_result_attachments.rb b/lib/submissions/generate_result_attachments.rb index e142b6bf..0699b40e 100644 --- a/lib/submissions/generate_result_attachments.rb +++ b/lib/submissions/generate_result_attachments.rb @@ -65,9 +65,11 @@ module Submissions page.rotate(0, flatten: true) if page[:Rotate] != 0 page[:Annots] ||= [] - page[:Annots] = page[:Annots].reject do |e| + page[:Annots] = page[:Annots].try(:reject) do |e| + next if e.is_a?(Integer) + e.present? && e[:A] && e[:A][:URI].to_s.starts_with?('file:///docuseal_field') - end + end || page[:Annots] width = page.box.width height = page.box.height