Error 500 viewing a merge request when source forked project is destroyed
Relates to gitlab-com/support-forum#1895
https://sentry.gitlap.com/gitlab/gitlabcom/issues/32170/
NoMethodError: undefined method `empty_repo?' for nil:NilClass
app/models/protected_branch.rb:50:in `protected?'
return true if project.empty_repo? && default_branch_protected?
lib/gitlab/user_access.rb:44:in `can_push_to_branch?'
if ProtectedBranch.protected?(project, ref)
app/presenters/merge_request_presenter.rb:187:in `user_can_push_to_source_branch?'
.can_push_to_branch?(source_branch)
app/presenters/merge_request_presenter.rb:85:in `rebase_path'
if !rebase_in_progress? && should_be_rebased? && user_can_push_to_source_branch?
app/serializers/merge_request_entity.rb:30:in `block in <class:MergeRequestEntity>'
presenter(merge_request).rebase_path
...
(173 additional frame(s) were not displayed)
ActionView::Template::Error: undefined method `empty_repo?' for nil:NilClass
ActionView::Template::Error: undefined method `empty_repo?' for nil:NilClass