Skip to content

Error 500 rendering an issue reference to a project that is in pending_delete

Created by @stanhu.

https://sentry.gitlap.com/gitlab/gitlabcom/issues/28053/

NoMethodError: undefined method `to_reference' for nil:NilClass
  app/models/issue.rb:135:in `to_reference'
    "#{project.to_reference(from, full: full)}#{reference}"
  lib/gitlab/metrics/instrumentation.rb:156:in `block in to_reference'
    trans.method_call_for(#{label.to_sym.inspect}).measure { super }
  lib/gitlab/metrics/method_call.rb:23:in `measure'
    retval = yield
  lib/gitlab/metrics/instrumentation.rb:156:in `to_reference'
    trans.method_call_for(#{label.to_sym.inspect}).measure { super }
  app/models/concerns/referable.rb:25:in `reference_link_text'
    to_reference(from_project)
...
(136 additional frame(s) were not displayed)

NoMethodError: undefined method `to_reference' for nil:NilClass