Skip to content

Commit f2929a4

Browse files
committed
[FINNA-3708] Fix potential null passed to mb_strtolower.
1 parent aed6652 commit f2929a4

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/RecordManager/Base/Record/Lido.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,11 @@ protected function getTopicIDs($exclude = ['iconclass']): array
493493
$result = [];
494494
foreach ($this->getSubjectNodes($exclude) as $subjectNode) {
495495
foreach ($this->xmlDoc->all($subjectNode, 'subjectConcept/conceptID') as $conceptID) {
496-
if ($id = $this->xmlDoc->value($conceptID)) {
497-
$type = mb_strtolower($this->xmlDoc->attr($conceptID, 'type'), 'UTF-8');
498-
if (in_array($type, $this->subjectConceptIDTypes)) {
496+
if (
497+
($id = $this->xmlDoc->value($conceptID))
498+
&& ($type = $this->xmlDoc->attr($conceptID, 'type'))
499+
) {
500+
if (in_array(mb_strtolower($type, 'UTF-8'), $this->subjectConceptIDTypes)) {
499501
$result[] = $id;
500502
}
501503
}

0 commit comments

Comments
 (0)