From 7c5cc8d2568c8c8d02e2de9565b734adf0a854f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 28 Jul 2016 15:19:34 +0200 Subject: [PATCH] Make sure we have at least two timestamps in lastmodified calculation Otherwise our max(*timestamps) call might fail --- src/octoprint/server/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/server/views.py b/src/octoprint/server/views.py index 6140eb4c..0a825e2f 100644 --- a/src/octoprint/server/views.py +++ b/src/octoprint/server/views.py @@ -530,7 +530,7 @@ def _files_for_index(): def _compute_date(files): from datetime import datetime - timestamps = map(lambda path: os.stat(path).st_mtime, files) + timestamps = map(lambda path: os.stat(path).st_mtime, files) + [0] if files else [] max_timestamp = max(*timestamps) if timestamps else None if max_timestamp: # we set the micros to 0 since microseconds are not speced for HTTP