From c4fa45266f2d4716a9dd5501984192d94724a62d Mon Sep 17 00:00:00 2001 From: Rory McNicholl Date: Fri, 19 Jan 2024 19:07:14 +0000 Subject: [PATCH] add safe nav for 'array_of_hash' (#511) --- .../shared/ubiquity/search_display/_show_array_hash.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/shared/ubiquity/search_display/_show_array_hash.html.erb b/app/views/shared/ubiquity/search_display/_show_array_hash.html.erb index dfae83f74..1e03d190a 100644 --- a/app/views/shared/ubiquity/search_display/_show_array_hash.html.erb +++ b/app/views/shared/ubiquity/search_display/_show_array_hash.html.erb @@ -1,4 +1,4 @@ -<% array_size = (array_of_hash.size <= 5 ? array_of_hash.size - 1 : 4) %> +<% array_size = (array_of_hash&.size <= 5 ? array_of_hash.size - 1 : 4) %> <% array_of_hash.each_with_index do |hash, index| %> <% if index <= 4 %> @@ -56,4 +56,4 @@ <% end %> <% end %> -<% end %> \ No newline at end of file +<% end %>