From 0e6c10a4d98e655deca5c80e39fccaaf0314fcee Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Thu, 10 Oct 2019 22:07:18 +0200 Subject: [PATCH] handle ror id not found. #348 --- app/controllers/concerns/facetable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/facetable.rb b/app/controllers/concerns/facetable.rb index 1c96c607f..6777a50ad 100644 --- a/app/controllers/concerns/facetable.rb +++ b/app/controllers/concerns/facetable.rb @@ -109,7 +109,7 @@ def facet_by_affiliation(arr) arr.map do |hsh| { "id" => hsh["key"], - "title" => affiliations.find { |a| a["id"] == hsh["key"] }.to_h["name"], + "title" => affiliations.find { |a| a["id"] == hsh["key"] }.to_h["name"] || hsh["key"], "count" => hsh["doc_count"] } end end