Commit 85a461e0 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Check if commit exists first in commit status API

parent 8c66d739
......@@ -20,8 +20,8 @@ module API
get ':id/repository/commits/:sha/statuses' do
authorize!(:read_commit_status, user_project)
ci_commit = user_project.ci_commit(params[:sha])
not_found!('Commit') unless user_project.commit(params[:sha])
ci_commit = user_project.ci_commit(params[:sha])
return [] unless ci_commit
statuses = ci_commit.statuses
......
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