Skip to content

NoMethodError: undefined method `head_sha' for nil:NilClass

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

NoMethodError: undefined method `head_sha' for nil:NilClass
  paginated_diff_entity.rb:14:in `block in <class:PaginatedDiffEntity>'
    Gitlab::CodeNavigationPath.new(merge_request.project, diffs.diff_refs.head_sha)
  grape_entity/entity.rb:496:in `instance_exec'
    instance_exec(object, options, &block)
  grape_entity/entity.rb:496:in `exec_with_object'
    instance_exec(object, options, &block)
  grape_entity/exposure/block_exposure.rb:10:in `value'
    entity.exec_with_object(options, &@block)
  grape_entity/exposure/base.rb:82:in `valid_value'
    value(entity, options) if valid?(entity)
...
(161 additional frame(s) were not displayed)

NoMethodError: undefined method `head_sha' for nil:NilClass