diff --git a/bundle/Controller/SitemapController.php b/bundle/Controller/SitemapController.php index a27581e..b50a0f9 100644 --- a/bundle/Controller/SitemapController.php +++ b/bundle/Controller/SitemapController.php @@ -141,7 +141,7 @@ protected function fillSitemap(DOMDocument $sitemap, DOMElement $root, SearchRes continue; } - $modified = $location->contentInfo->modificationDate->format('c'); + $modified = $location->contentInfo->modificationDate?->format('c'); $loc = $sitemap->createElement('loc', $url); $lastmod = $sitemap->createElement('lastmod', $modified); $urlElt = $sitemap->createElement('url');