Skip to content

Commit

Permalink
Fix 'trim(): Passing null to parameter 1' (closed swissup/module-sear…
Browse files Browse the repository at this point in the history
  • Loading branch information
0m3r committed Jan 13, 2023
1 parent 2e8a7e7 commit ef52b31
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Plugin/SetEmptyStringIfOutputEmpty.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public function afterToHtml(
\Magento\Framework\View\Element\AbstractBlock $subject,
$resultHtml
) {
if (!is_string($resultHtml)) {
return $resultHtml;
}
$html = trim($resultHtml, " \n");
return empty($html) ? $html : $resultHtml;
}
Expand Down

0 comments on commit ef52b31

Please sign in to comment.