Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-02-16 14:40:06 +0300
committerDouwe Maan <douwe@gitlab.com>2016-02-16 14:40:06 +0300
commit8db62f25480562e8497c3fb6d9f4611fc5902d94 (patch)
treee02c69ae311f6fd734b55dec865c54727da13132 /app
parent1563caf4375bcb63f1a4ac3fa4897263c3c3f98c (diff)
parentf5ab126fd0e607811638ca36b6752d5c74535adf (diff)
Merge branch 'rs-issue-13467' into 'master'
Ensure Commit#show responds 404 instead of 500 when given an invalid ID Closes #13467 See merge request !2823
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/commit_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb
index 21f4d9f44ec..36951b91372 100644
--- a/app/controllers/projects/commit_controller.rb
+++ b/app/controllers/projects/commit_controller.rb
@@ -11,8 +11,6 @@ class Projects::CommitController < Projects::ApplicationController
before_action :define_show_vars, only: [:show, :builds]
def show
- return git_not_found! unless @commit
-
apply_diff_view_cookie!
@line_notes = commit.notes.inline
@@ -68,6 +66,8 @@ class Projects::CommitController < Projects::ApplicationController
end
def define_show_vars
+ return git_not_found! unless commit
+
if params[:w].to_i == 1
@diffs = commit.diffs({ ignore_whitespace_change: true })
else