From 012841403033a962dfa5154737968f5f06c1e463 Mon Sep 17 00:00:00 2001 From: Ayoub Date: Tue, 15 Oct 2024 11:21:03 +0100 Subject: [PATCH] fix modified date null --- bundle/Controller/SitemapController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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');