diff --git a/rhodecode/apps/hovercards/views.py b/rhodecode/apps/hovercards/views.py --- a/rhodecode/apps/hovercards/views.py +++ b/rhodecode/apps/hovercards/views.py @@ -34,7 +34,7 @@ from rhodecode.lib.codeblocks import fil from rhodecode.lib.index import searcher_from_config from rhodecode.lib.utils2 import safe_unicode, str2bool, safe_int from rhodecode.lib.ext_json import json -from rhodecode.lib.vcs.exceptions import CommitDoesNotExistError +from rhodecode.lib.vcs.exceptions import CommitDoesNotExistError, EmptyRepositoryError from rhodecode.lib.vcs.nodes import FileNode from rhodecode.model.db import ( func, true, or_, case, in_filter_generator, Repository, RepoGroup, User, UserGroup, PullRequest) @@ -102,8 +102,9 @@ class HoverCardsRepoView(RepoAppView): commit_id = self.request.matchdict['commit_id'] pre_load = ['author', 'branch', 'date', 'message'] try: - c.commit = self.rhodecode_vcs_repo.get_commit(commit_id=commit_id, pre_load=pre_load) - except CommitDoesNotExistError: + c.commit = self.rhodecode_vcs_repo.get_commit( + commit_id=commit_id, pre_load=pre_load) + except (CommitDoesNotExistError, EmptyRepositoryError): raise HTTPNotFound() return self._get_template_context(c)