Skip to content

Commit

Permalink
Avoid passing null to strtolower(). (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz authored Mar 8, 2024
1 parent 46300f2 commit 9b9b638
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/OaiPmh/RecordWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function write($records)

// Save the current record, either as a deleted or as a regular file:
$attribs = $record->header->attributes();
if (strtolower($attribs['status']) == 'deleted') {
if (strtolower($attribs['status'] ?? '') == 'deleted') {
$this->strategy->addDeletedRecord($id);
} else {
$recordXML = $this->recordFormatter->format($id, $record);
Expand Down

0 comments on commit 9b9b638

Please sign in to comment.