Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Abe Jellinek <[email protected]>
  • Loading branch information
adam3smith and AbeJellinek authored Mar 23, 2024
1 parent 8e33293 commit 8b73afb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Datacite JSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ function doImport() {
// we only grab the container info for IsPublishedIn, i.e. mostly books for chapter & journals
item.volume = container.volume;
if (container.titles) {
if (Array.isArray(container.titles)) {
if (Array.isArray(container.titles) && container.titles.length) {
item.publicationTitle = container.titles[0].title;
}
else {
Expand All @@ -288,11 +288,11 @@ function doImport() {
item.pages = container.firstPage + "-" + container.lastPage;
}
else {
item.pages = container.firstPage + container.lastPage;
item.pages = (container.firstPage || "") + (container.lastPage || "");
}

item.edition = container.edition;
if (container.contributor) {
if (container.contributor && Array.isArray(container.contributor)) {
for (let contributor of container.contributor) {
let role = "contributor";
if (contributor.contributorType == "Editor") {
Expand Down

0 comments on commit 8b73afb

Please sign in to comment.