Permalink
Browse files

Fix the index out of range on genKey function.

  • Loading branch information...
ivanteoh committed Jan 2, 2013
1 parent dc3c21a commit 7665ad3948a6eb039e9c66a06fa3d5c2c4814938
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/collective/listingviews/utils.py
@@ -399,4 +399,7 @@ def genKey(self, index):
index_prefix = "i"
return "%s%05d" % (index_prefix, index)
else:
- return self.keys.value[index]
+ if index < len(self.keys.value):
+ return self.keys.value[index]
+ # this could happen during registering menu items, not sure why
+ raise StopIteration

0 comments on commit 7665ad3

Please sign in to comment.