From 91b48c6982384f728af5ced804f705b9b8980b70 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Mon, 27 May 2019 21:18:18 +0200 Subject: [PATCH] handle missing nameIdentifier. #283 --- app/graphql/types/researcher_type.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/graphql/types/researcher_type.rb b/app/graphql/types/researcher_type.rb index 8073a6dff..b4a3c3104 100644 --- a/app/graphql/types/researcher_type.rb +++ b/app/graphql/types/researcher_type.rb @@ -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)