diff --git a/src/VersionFeed.php b/src/VersionFeed.php index ad7e1bc..9c7fb2c 100644 --- a/src/VersionFeed.php +++ b/src/VersionFeed.php @@ -94,7 +94,7 @@ class VersionFeed extends SiteTreeExtension 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( @@ -107,7 +107,7 @@ class VersionFeed extends SiteTreeExtension } 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('