From 128b1eae092e4ee9384c99a4ba72b9122fc17e89 Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Tue, 7 Feb 2017 15:16:46 +0100 Subject: Update Rubocop to ruby 2.3 --- lib/api/branches.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/api/branches.rb') diff --git a/lib/api/branches.rb b/lib/api/branches.rb index be659fa4a6a..9331be1f7de 100644 --- a/lib/api/branches.rb +++ b/lib/api/branches.rb @@ -84,7 +84,7 @@ module API branch = user_project.repository.find_branch(params[:branch]) not_found!("Branch") unless branch protected_branch = user_project.protected_branches.find_by(name: branch.name) - protected_branch.destroy if protected_branch + protected_branch&.destroy present branch, with: Entities::RepoBranch, project: user_project end -- cgit v1.2.1