Fix crash on viewing the front page the first time.
authorEevee <git@veekun.com>
Wed, 18 Aug 2010 05:00:15 +0000 (22:00 -0700)
committerEevee <git@veekun.com>
Wed, 18 Aug 2010 05:00:15 +0000 (22:00 -0700)
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