diff --git a/app/graphql/types/doi_item.rb b/app/graphql/types/doi_item.rb index 8aa909111..8c822306f 100644 --- a/app/graphql/types/doi_item.rb +++ b/app/graphql/types/doi_item.rb @@ -179,7 +179,7 @@ module DoiItem end def type - object.types["resourceTypeGeneral"] + object.types["resourceTypeGeneral"] || "Work" end def creators(**args) diff --git a/app/models/doi.rb b/app/models/doi.rb index 7898ac351..7cb312d3f 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -1905,9 +1905,9 @@ def set_defaults end def update_agency - if agency.casecmp?("datacite") || agency.blank? + if agency.to_s.casecmp?("datacite") || agency.blank? self.agency = "datacite" - elsif agency.casecmp? ("crossref") + elsif agency.to_s.casecmp? ("crossref") self.agency = "crossref" end end