Skip to content

Commit c6d4728

Browse files
committed
guard against nil errors
1 parent bdde5f4 commit c6d4728

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/views/case_contacts/case_contacts_new_design/index.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<i class="fa-solid fa-chevron-down"></i>
4040
</td>
4141
<td>
42-
<%= I18n.l(case_contact[:occurred_at], format: :full) %>
42+
<%= I18n.l(case_contact[:occurred_at], format: :full) if case_contact[:occurred_at].present? %>
4343
</td>
4444
<td>
4545
<%= @presenter.display_case_number(casa_case_id) %>
@@ -48,7 +48,7 @@
4848
<%= case_contact.decorate.contact_types_comma_separated %>
4949
</td>
5050
<td>
51-
<%= case_contact.medium_type.capitalize %>
51+
<%= case_contact.medium_type&.capitalize %>
5252
</td>
5353
<td>
5454
<% if policy(case_contact).edit? %>
@@ -73,7 +73,7 @@
7373
<% else %>
7474
<i class="lni lni-cross-circle" style="color: orange;"></i>
7575
<% end %>
76-
<%= "(#{"%02d:%02d" % [case_contact.duration_minutes / 60, case_contact.duration_minutes % 60]})" %>
76+
<%= "(#{"%02d:%02d" % [case_contact.duration_minutes / 60, case_contact.duration_minutes % 60]})" if case_contact.duration_minutes %>
7777
</td>
7878
<td>
7979
<%= case_contact.contact_topics.map(&:question).join(" | ") %>

0 commit comments

Comments
 (0)