Skip to content

Commit 0fe2aa2

Browse files
jkeckcbeer
authored andcommitted
Safe navigate when iterating over the documents ivar in various export views
1 parent 81666fc commit 0fe2aa2

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

app/views/catalog/_citation.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</button>
66
</div>
77
<div class="modal-body">
8-
<% @documents.each do |document| %>
8+
<% @documents&.each do |document| %>
99
<h1 class="modal-title"><%= document_heading(document) %></h1>
1010

1111
<% if document.respond_to?(:export_as_mla_citation_txt) %>

app/views/catalog/_email_form.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</div>
2525
</div>
2626

27-
<% @documents.each do |doc| %>
27+
<% @documents&.each do |doc| %>
2828
<%=hidden_field_tag "id[]", doc.id %>
2929
<% end %>
3030
<%- if params[:sort] -%>

app/views/catalog/_sms_form.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</div>
2323

2424
</div>
25-
<% @documents.each do |doc| %>
25+
<% @documents&.each do |doc| %>
2626
<%=hidden_field_tag "id[]", doc.id %>
2727
<% end %>
2828
</div>

0 commit comments

Comments
 (0)