Skip to content

Commit

Permalink
FIX: Make sureHtmlDiff::compareHTML is not passed null values
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-dna committed Feb 12, 2024
1 parent b9ee99d commit c10085c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/VersionFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function getDiffList($highestVersion = null, $limit = 100)
if (isset($previous)) {
// Produce the diff fields for use in the template.
if ($version->Title != $previous->Title) {
$diffTitle = HtmlDiff::compareHTML($version->Title, $previous->Title);
$diffTitle = HtmlDiff::compareHTML($version->Title ?? '', $previous->Title ?? '');

$version->DiffTitle = DBField::create_field('HTMLText', null);
$version->DiffTitle->setValue(
Expand All @@ -107,7 +107,7 @@ public function getDiffList($highestVersion = null, $limit = 100)
}

if ($version->Content != $previous->Content) {
$diffContent = HtmlDiff::compareHTML($version->Content, $previous->Content);
$diffContent = HtmlDiff::compareHTML($version->Content ?? '', $previous->Content ?? '');

$version->DiffContent = DBField::create_field('HTMLText', null);
$version->DiffContent->setValue('<div>'.$diffContent.'</div>');
Expand Down

0 comments on commit c10085c

Please sign in to comment.