Skip to content

Commit 82ed9fd

Browse files
committed
Check if mdSection is null to prevent exception
1 parent e35d1b1 commit 82ed9fd

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

Classes/Common/MetsDocument.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -600,15 +600,17 @@ private function processMetadataSections(string $id, int $cPid, array $metadata)
600600
foreach ($mdIds as $dmdId) {
601601
$mdSectionType = $this->mdSec[$dmdId]['section'];
602602

603-
if ($this->hasMetadataSection($metadataSections, $mdSectionType, 'dmdSec')) {
604-
continue;
605-
}
603+
if ($mdSectionType !== null) {
604+
if ($this->hasMetadataSection($metadataSections, $mdSectionType, 'dmdSec')) {
605+
continue;
606+
}
606607

607-
if (!$this->extractAndProcessMetadata($dmdId, $mdSectionType, $metadata, $cPid, $metadataSections)) {
608-
continue;
609-
}
608+
if (!$this->extractAndProcessMetadata($dmdId, $mdSectionType, $metadata, $cPid, $metadataSections)) {
609+
continue;
610+
}
610611

611-
$metadataSections[] = $mdSectionType;
612+
$metadataSections[] = $mdSectionType;
613+
}
612614
}
613615
}
614616

0 commit comments

Comments
 (0)