# HG changeset patch # User Marcin Kuzminski # Date 2011-05-13 14:53:46 # Node ID 1188920ae12cfd098bc8ad9cae4a7cc3c0b9749b # Parent c33842b1bd384881f4da8c45d54e2415bd286c7c fixed error when given page in pagination was out of range in changelog view diff --git a/rhodecode/controllers/changelog.py b/rhodecode/controllers/changelog.py --- a/rhodecode/controllers/changelog.py +++ b/rhodecode/controllers/changelog.py @@ -90,9 +90,13 @@ class ChangelogController(BaseRepoContro revcount = min(repo_size, size) offset = 1 if p == 1 else ((p - 1) * revcount + 1) - rev_start = repo.revisions.index(repo.revisions[(-1 * offset)]) + try: + rev_start = repo.revisions.index(repo.revisions[(-1 * offset)]) + except IndexError: + rev_start = repo.revisions.index(repo.revisions[-1]) rev_end = max(0, rev_start - revcount) + data = [] if repo.alias == 'git': for _ in xrange(rev_end, rev_start):