From ca71f26d5653ae913ae45678349ee2e933e296d9 Mon Sep 17 00:00:00 2001 From: kjgarza Date: Mon, 3 Feb 2020 19:58:55 +0100 Subject: [PATCH] fix for empty case --- app/controllers/concerns/metrics_helper.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/concerns/metrics_helper.rb b/app/controllers/concerns/metrics_helper.rb index c2701a33d..ec71c1b98 100644 --- a/app/controllers/concerns/metrics_helper.rb +++ b/app/controllers/concerns/metrics_helper.rb @@ -11,6 +11,10 @@ def get_metrics_array(dois) end def get_person_metrics(orcid) + if orcid.blank? + return { citations: 0, views: 0, downloads: 0 } + end + dois = get_person_dois(orcid).join(",") usage = EventsQuery.new.views_and_downloads(dois) {