Skip to content

Commit

Permalink
Fix passing null to trim()
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesDPC committed Jan 8, 2025
1 parent 3dff4b6 commit 5d22e80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Models/AuthenticationHelpPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function requireDefaultRecords()
$page = AuthenticationHelpPage::create();
$page->Title = _t(self::class . '.PageTitle', 'Multi-Factor Authentication');
$page->AuthenticationHelpHeading = _t(self::class . '.SubHeading', 'Setting up MFA');
$page->AuthenticationHelpContent = trim($content);
$page->AuthenticationHelpContent = trim($content ?? '');
$page->write();
}

Expand Down Expand Up @@ -114,7 +114,7 @@ public function getCMSFields()
public function onBeforeWrite()
{
parent::onBeforeWrite();
$this->AuthenticationHelpContent = trim($this->AuthenticationHelpContent);
$this->AuthenticationHelpContent = trim($this->AuthenticationHelpContent ?? '');
}

public function MFARequired()
Expand Down

0 comments on commit 5d22e80

Please sign in to comment.