Skip to content

Commit

Permalink
fix for empty case
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Feb 3, 2020
1 parent d92aa60 commit ca71f26
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/concerns/metrics_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit ca71f26

Please sign in to comment.