#3163 log_exceptions created when a commit with missing merge objects is viewed
Closed: Fixed Opened by wattersmt.

Viewing commits in a project causes pagure to send out error emails whenever a commit with missing objects is viewed.

For example, the server admin will receive a stack trace like this.

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python2.7/site-packages/pagure/internal/__init__.py", line 510, in get_branches_of_commit
    branch.get_object().hex
AttributeError: 'NoneType' object has no attribute 'hex'

This is caused by the repo_obj.merge_base(compare_branch.get_object().hex, branch.get_object().hex)) method returning None.


Metadata Update from @pingou:
- Issue tagged with: bug

Commit 46abcf94 fixes this issue

Metadata