lib/commonmeta/readers/datacite_reader.rb in commonmeta-ruby-3.9.0 vs lib/commonmeta/readers/datacite_reader.rb in commonmeta-ruby-3.11.0

- old
+ new

@@ -53,10 +53,16 @@ titles = Array.wrap(meta.fetch('titles', nil)).map do |title| title.compact end contributors = get_authors(from_datacite(meta.fetch('creators', nil))) contributors += get_authors(from_datacite(meta.fetch('contributors', nil))) - publisher = { 'name' => meta.fetch('publisher', nil) } + if meta.fetch('publisher', nil).is_a?(Hash) + publisher = { 'name' => meta.fetch('publisher', nil).fetch('name', nil) } + elsif meta.fetch('publisher', nil).is_a?(String) + publisher = { 'name' => meta.fetch('publisher', nil) } + else + publisher = nil + end container = meta.fetch('container', nil) funding_references = meta.fetch('funding_references', nil) date = {}