NoMethodError: undefined method `scoped_label?' for nil:NilClass

https://sentry.gitlab.net/gitlab/gitlabcom/issues/847920/ (internal)

NoMethodError: undefined method `scoped_label?' for nil:NilClass
  ee/label_note.rb:21:in `scoped_labels_event?'
    events.first.label.scoped_label?
  ee/label_note.rb:17:in `added_suffix'
    scoped_labels_event? ?  'scoped' : super
  label_note.rb:65:in `note_text'
    added = labels_str(label_refs_by_action('add', html), prefix: 'added', suffix: added_suffix)
  label_note.rb:43:in `note_html'
    @note_html ||= "<p dir=\"auto\">#{note_text(html: true)}</p>"
  cache_markdown_field.rb:87:in `cached_html_for'
    __send__(cached_markdown_fields.html_field(markdown_field)) # rubocop:disable GitlabSecurity/PublicSend
...
(139 additional frame(s) were not displayed)

NoMethodError: undefined method `scoped_label?' for nil:NilClass
Edited by Peter Leitzen