From d3a9b5811fb4efad483ff2a2b875a6faf0eadded Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sun, 24 Nov 2019 14:48:59 +0100 Subject: [PATCH] handle doi import error --- app/models/doi.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index d262ae2f8..2479c99ea 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -939,7 +939,7 @@ def current_media end def resource_type - cached_resource_type_response(types["resourceTypeGeneral"].underscore.dasherize.downcase) if types.to_h["resourceTypeGeneral"].present? + cached_resource_type_response(types["resourceTypeGeneral"].underscore.dasherize.downcase) if types.is_a?(Hash) && types["resourceTypeGeneral"].present? end def date_registered