summaryrefslogtreecommitdiff
path: root/lib/api/helpers/notes_helpers.rb
diff options
context:
space:
mode:
authorPatrick Derichs <pderichs@gitlab.com>2019-06-19 11:07:17 +0200
committerPatrick Derichs <pderichs@gitlab.com>2019-06-19 11:07:17 +0200
commit5469d21d02d2969f7b1c629ebd5e5696c664736c (patch)
treeb9a2af1ee11438b6f2ba94b2985a01a980d61100 /lib/api/helpers/notes_helpers.rb
parent9079085fe7b03a330a50ddee638990af42b22bda (diff)
downloadgitlab-ce-5469d21d02d2969f7b1c629ebd5e5696c664736c.tar.gz
Simplify result of find_noteablepderichs-52123
Diffstat (limited to 'lib/api/helpers/notes_helpers.rb')
-rw-r--r--lib/api/helpers/notes_helpers.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/api/helpers/notes_helpers.rb b/lib/api/helpers/notes_helpers.rb
index c444766249d..b03ac7deb71 100644
--- a/lib/api/helpers/notes_helpers.rb
+++ b/lib/api/helpers/notes_helpers.rb
@@ -78,9 +78,7 @@ module API
noteable = NotesFinder.new(user_project, current_user, params).target
noteable = nil unless can?(current_user, noteable_read_ability_name(noteable), noteable)
- return not_found!(noteable_type) unless noteable
-
- noteable
+ noteable || not_found!(noteable_type)
end
def params_by_noteable_type_and_id(type, id)