diff --git a/lib/templates/build_annotations.rb b/lib/templates/build_annotations.rb index 5417e51a..f3fca7c1 100644 --- a/lib/templates/build_annotations.rb +++ b/lib/templates/build_annotations.rb @@ -10,6 +10,7 @@ module Templates pdf.pages.flat_map.with_index do |page, index| annotations = page.objects.deref!(page.attributes[:Annots]) || [] annotations.filter_map do |annot| + next if annot.nil? next if annot[:A].blank? || annot[:A][:URI].blank? next unless annot[:Subtype] == :Link next if !annot[:A][:URI].starts_with?('https://') && !annot[:A][:URI].starts_with?('http://')