[pp:mtime] do not overwrite '_mtime' for None values (#5439)

This commit is contained in:
Mike Fährmann
2024-04-07 02:31:21 +02:00
parent 647a87d17c
commit 0e730ba980
2 changed files with 13 additions and 0 deletions

View File

@@ -33,6 +33,9 @@ class MtimePP(PostProcessor):
def run(self, pathfmt):
mtime = self._get(pathfmt.kwdict)
if mtime is None:
return
pathfmt.kwdict["_mtime"] = (
util.datetime_to_timestamp(mtime)
if isinstance(mtime, datetime) else