Resolve "Error 500 loading merge request: undefined method `index' for nil:NilClass"
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
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Tests added for this feature/bug - Review
-
Has been reviewed by Backend
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
End-to-end tests pass ( package-qa
manual pipeline job)
What are the relevant issue numbers?
Closes #42160 (closed).
Merge request reports
Activity
assigned to @smcgivern
marked the checklist item Changelog entry added, if necessary as completed
added 1 commit
- 382421a9 - Fix truncated_diff_lines for legacy notes without a line
@DouweM could you take a look please?
assigned to @DouweM
mentioned in commit de7703a9
mentioned in issue #43226 (closed)
Picked into https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17124, will merge into
10-4-stable
ready for10.4.4
mentioned in commit 721a26d9
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) Ah, yes, there's already issue for this with the same conclusion: https://gitlab.com/gitlab-org/gitlab-ce/issues/43783#note_71492136.
Edited by Jakub Jirutka
added devopsplan label