diff --git a/app/controllers/commit_controller.rb b/app/controllers/commit_controller.rb index 1329410891d9f5c4c5b4fed410e65d0682ffd729..0f696ef9f5aef6e375d15a28ca6224534298f96d 100644 --- a/app/controllers/commit_controller.rb +++ b/app/controllers/commit_controller.rb @@ -11,7 +11,11 @@ class CommitController < ProjectResourceController result = CommitLoadContext.new(project, current_user, params).execute @commit = result[:commit] - git_not_found! unless @commit + + if @commit.nil? + git_not_found! + return + end @suppress_diff = result[:suppress_diff]