lib/bolognese/readers/datacite_reader.rb in bolognese-0.9.72 vs lib/bolognese/readers/datacite_reader.rb in bolognese-0.9.73
- old
+ new
@@ -13,11 +13,11 @@
return { "string" => nil, "state" => "not_found" } unless attributes.present?
client_id = response.body.dig("data", "relationships", "client", "data", "id").upcase
provider_id = response.body.dig("data", "relationships", "provider", "data", "id").upcase
- string = attributes.fetch('xml', "PGhzaD48L2hzaD4=\n")
- string = Base64.decode64(string)
+ string = attributes.fetch('xml', nil)
+ string = Base64.decode64(string) if string.present?
if string.present?
doc = Nokogiri::XML(string, nil, 'UTF-8', &:noblanks)
# remove leading and trailing whitespace in text nodes