Skip to content

Commit

Permalink
handle missing nameIdentifier. #283
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed May 27, 2019
1 parent 1515357 commit 91b48c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/graphql/types/researcher_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ResearcherType < BaseObject
end

def id
object.fetch(:id, nil) || object.fetch("nameIdentifiers", []).find { |n| n.fetch("nameIdentifierScheme", nil) == "ORCID" }.fetch("nameIdentifier", nil)
object.fetch(:id, nil) || object.fetch("nameIdentifiers", []).find { |n| n.fetch("nameIdentifierScheme", nil) == "ORCID" }.to_h.fetch("nameIdentifier", nil)
end

def datasets(**args)
Expand Down

0 comments on commit 91b48c6

Please sign in to comment.