larsgw / citation.js

Citation.js converts formats like BibTeX, Wikidata JSON and ContentMine JSON to CSL-JSON to convert to other formats like APA, Vancouver and back to BibTeX.
https://citation.js.org/
MIT License
222 stars 30 forks source link

DOI: "TypeError: Cannot read property '0' of undefined" #147

Closed larsgw closed 6 years ago

larsgw commented 6 years ago

Caused due to this line:

https://github.com/larsgw/citation.js/blob/97641fa1cfc753c261adcc25efe0aa9284418536/src/parse/modules/doi/json.js#L24

AFAIK, it's only a problem for certain DataCite DOIs, when submitted (or any other date) is nil. In that case, Bolognese, the DataCite metadata conversion utility (mistakenly, I assume) returns date_parts instead of date-parts. I made a PR: https://github.com/datacite/bolognese/pull/27.