fix(Elife): Reference lacking a volume is not an Thema error
@@ -11,15 +11,14 @@ const moveTitles = (references: Element[]): Element[] => {
}
const moveVolumeNames = (references: Element[]): Element[] => {
- references.forEach((reference: Element, i: number): void => {
+ references.forEach((reference: Element): void => {
const volume = first(reference, ':--PublicationVolume:--isPartOf')
- if (volume === null) {
- throw new Error(`No volume found for reference ${i}`)
- }
- const volumeName = first(volume, ':--Periodical:--isPartOf')
+ if (volume !== null) {
+ const volumeName = first(volume, ':--isPartOf')
if (volumeName !== null) {
prepend(volume, volumeName)
}
+ }
})
return references
}
