From 288b050e5b226e403f9c88c3fe16fb4279714d69 Mon Sep 17 00:00:00 2001 From: Toon Claes Date: Fri, 28 Jun 2019 14:28:29 +0200 Subject: Enable Style/SafeNavigation cop I ran `rubocop -a --only Style/SafeNavigation` to correct all. I could not enable `ConvertTry` cause it does not seem to be supported by the version we're using. https://gitlab.com/gitlab-org/gitlab-ce/issues/63875 --- app/helpers/diff_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/helpers/diff_helper.rb') diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index 32431959851..77c2622304c 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -71,12 +71,12 @@ module DiffHelper discussions_left = discussions_right = nil - if left && left.discussable? && (left.unchanged? || left.removed?) + if left&.discussable? && (left.unchanged? || left.removed?) line_code = diff_file.line_code(left) discussions_left = @grouped_diff_discussions[line_code] end - if right && right.discussable? && right.added? + if right&.discussable? && right.added? line_code = diff_file.line_code(right) discussions_right = @grouped_diff_discussions[line_code] end -- cgit v1.2.1