Permalink
Browse files

Don't explode on an empty database

  • Loading branch information...
1 parent c699d24 commit c3dc8aa2215602ad8155a925366cade5ea3c1f54 @encukou encukou committed Apr 19, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 splinext/forum/controllers/forum.py
View
6 splinext/forum/controllers/forum.py
@@ -112,7 +112,11 @@ def forums(self):
c.forum_volume = forum_cache.get_value(
key='forum_volume', createfunc=get_forum_volume)
- c.max_volume = max(c.forum_volume.itervalues()) or 1
+ try:
+ c.max_volume = max(c.forum_volume.itervalues()) or 1
+ except ValueError:
+ # Empty database
+ c.max_volume = 1
# Need to know the last post for each forum, in realtime
c.last_post = {}

0 comments on commit c3dc8aa

Please sign in to comment.