Skip to content

Commit 577018a

Browse files
authored
Merge pull request #3171 from nicolasfranck/fix_metadata_search_result
metadata standard does not always have locations
2 parents 214a0c9 + b5295cb commit 577018a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/views/research_outputs/metadata_standards/_search_result.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<p><%= sanitize(result.description) %></p>
77

8-
<% website = result.locations.select { |loc| loc["type"] == "website" }.first %>
8+
<% website = result&.locations&.select { |loc| loc["type"] == "website" }&.first %>
99
<% if website.present? %>
1010
<div>
1111
<%= link_to website["url"], website["url"], target: "_blank", class: "has-new-window-popup-info" %>

0 commit comments

Comments
 (0)