mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #34088 -- Fixed Sitemap.get_latest_lastmod() crash with empty items.
Bug in 480191244d.
Thanks Michal Čihař for the report.
This commit is contained in:
committed by
Mariusz Felisiak
parent
444b6da7cc
commit
5eab4d1924
@@ -167,7 +167,7 @@ class Sitemap:
|
||||
return None
|
||||
if callable(self.lastmod):
|
||||
try:
|
||||
return max([self.lastmod(item) for item in self.items()])
|
||||
return max([self.lastmod(item) for item in self.items()], default=None)
|
||||
except TypeError:
|
||||
return None
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user