Commit 1bc0e9e3 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Apply additional guard-clauses for unfold_required?

parent ec66ef1b
...@@ -54,7 +54,8 @@ module Gitlab ...@@ -54,7 +54,8 @@ module Gitlab
def unfold_required? def unfold_required?
strong_memoize(:unfold_required) do strong_memoize(:unfold_required) do
next false unless @diff_file.text? next false unless @diff_file.text?
next false if @blob.nil? next false unless @position.unchanged?
next false if @diff_file.new_file? || @diff_file.deleted_file?
next false unless @position.old_line next false unless @position.old_line
# Invalid position (MR import scenario) # Invalid position (MR import scenario)
next false if @position.old_line > @blob.lines.size next false if @position.old_line > @blob.lines.size
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment