From: Eevee Date: Wed, 18 Aug 2010 05:00:15 +0000 (-0700) Subject: Fix crash on viewing the front page the first time. X-Git-Tag: veekun-promotions/2010082201~2 X-Git-Url: http://git.veekun.com/zzz-spline-frontpage.git/commitdiff_plain/e37070097adebe37eaf3f95d71a5005b749f3ff3 Fix crash on viewing the front page the first time. --- diff --git a/splinext/frontpage/controllers/frontpage.py b/splinext/frontpage/controllers/frontpage.py index a77edb2..fee79aa 100644 --- a/splinext/frontpage/controllers/frontpage.py +++ b/splinext/frontpage/controllers/frontpage.py @@ -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