500 error when editing MR target branch

Summary

500 error when attempting to edit an MR and change the target branch.

Steps to reproduce

Unable to reproduce.

What is the current bug behavior?

A 500 error is thrown and the MR is not edited.

What is the expected correct behavior?

The MR should successfully show the new target branch.

Relevant logs and/or screenshots

https://sentry.gitlab.net/gitlab/gitlabcom/issues/3152641/?referrer=gitlab_plugin

NoMethodError: undefined method `hook_attrs' for nil:NilClass
  lib/gitlab/hook_data/issuable_builder.rb:14:in `build'
    user: user.hook_attrs,
  app/models/concerns/issuable.rb:494:in `to_hook_data'
    Gitlab::HookData::IssuableBuilder.new(self).build(user: user, changes: changes)
  app/services/merge_requests/base_service.rb:13:in `hook_data'
    hook_data = merge_request.to_hook_data(current_user, old_associations: old_associations)
  app/services/merge_requests/base_service.rb:23:in `execute_hooks'
    merge_data = hook_data(merge_request, action, old_rev: old_rev, old_associations: old_associations)
  app/services/merge_requests/resolved_discussion_notification_service.rb:9:in `execute'
    execute_hooks(merge_request, 'update')
...
(223 additional frame(s) were not displayed)

Output of checks

This bug happens on GitLab.com.

Workaround

Submitting a new MR with the necessary changes.

Edited by Alejandro Guerrero