Commit 9db06da4fa5fc42859dce01a91cc607c7ba9f738
Exists in
master
and in
4 other branches
Merge pull request #4176 from Andrew8xx8/patch-2
500 error on showing not existed commit fixed
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
app/controllers/commit_controller.rb
... | ... | @@ -11,7 +11,11 @@ class CommitController < ProjectResourceController |
11 | 11 | result = CommitLoadContext.new(project, current_user, params).execute |
12 | 12 | |
13 | 13 | @commit = result[:commit] |
14 | - git_not_found! unless @commit | |
14 | + | |
15 | + if @commit.nil? | |
16 | + git_not_found! | |
17 | + return | |
18 | + end | |
15 | 19 | |
16 | 20 | @suppress_diff = result[:suppress_diff] |
17 | 21 | ... | ... |