Fix crash on viewing the front page the first time.
[zzz-spline-frontpage.git] / splinext / frontpage / controllers / frontpage.py
index a77edb2..fee79aa 100644 (file)
@@ -79,9 +79,9 @@ class FrontPageController(BaseController):
                 times.append( int(source['frontpage-last-seen-time']) )
             except (KeyError, ValueError):
                 pass
-        last_seen_time = datetime.datetime.fromtimestamp(max(times))
 
-        if last_seen_time:
+        if times:
+            last_seen_time = datetime.datetime.fromtimestamp(max(times))
             for update in updates:
                 if update.time > last_seen_time:
                     c.last_seen_item = update