From 5469d21d02d2969f7b1c629ebd5e5696c664736c Mon Sep 17 00:00:00 2001 From: Patrick Derichs Date: Wed, 19 Jun 2019 11:07:17 +0200 Subject: Simplify result of find_noteable --- lib/api/helpers/notes_helpers.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/api/helpers/notes_helpers.rb') 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) -- cgit v1.2.1