Skip to content
Snippets Groups Projects

Resolve "Error 500 loading merge request: undefined method `index' for nil:NilClass"

1 unresolved thread

What does this MR do?

Fixes a 500 error with an invalid legacy diff note on a page.

Are there points in the code the reviewer needs to double check?

This doesn't do anything useful, it just doesn't blow up (see screenshot). Should we do more?

Why was this MR needed?

If a legacy diff note is wrong, this will blow up.

Screenshots

image

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #42160 (closed).

Edited by Sean McGivern

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
37 37
38 38 # Returns an array of at most 16 highlighted lines above a diff note
39 39 def truncated_diff_lines(highlight: true)
40 return [] if diff_line.nil? && first_note.is_a?(LegacyDiffNote)
  • Please register or sign in to reply
    Loading