lib/bolognese/readers/schema_org_reader.rb in bolognese-1.1.12 vs lib/bolognese/readers/schema_org_reader.rb in bolognese-1.1.13

- old
+ new

@@ -59,10 +59,13 @@ "citeproc" => Bolognese::Utils::SO_TO_CP_TRANSLATIONS[schema_org] || "article-journal", "bibtex" => Bolognese::Utils::SO_TO_BIB_TRANSLATIONS[schema_org] || "misc", "ris" => Bolognese::Utils::SO_TO_RIS_TRANSLATIONS[resource_type_general.to_s.dasherize] || "GEN" }.compact authors = meta.fetch("author", nil) || meta.fetch("creator", nil) - creators = get_authors(from_schema_org_creators(Array.wrap(authors))) + # Authors should be an object, if it's just a plain string don't try and parse it. + if not authors.is_a?(String) + creators = get_authors(from_schema_org_creators(Array.wrap(authors))) + end contributors = get_authors(from_schema_org_contributors(Array.wrap(meta.fetch("editor", nil)))) publisher = parse_attributes(meta.fetch("publisher", nil), content: "name", first: true) ct = (schema_org == "Dataset") ? "includedInDataCatalog" : "Periodical" container = if meta.fetch(ct, nil).present?