summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMartin Cabrera <martin@kisland.com>2017-01-10 23:11:36 +0100
committerMartin Cabrera <martin@kisland.com>2017-01-10 23:15:56 +0100
commit5dc8fe31ba19f321041d2ad5c73765062d41a312 (patch)
tree709b0e13c23963efc955c5fbbe3cd576bc30fcb6 /app
parent6ff989cd6d8bb35f237bd2fb398c8b2276189f29 (diff)
downloadgitlab-ce-5dc8fe31ba19f321041d2ad5c73765062d41a312.tar.gz
Fix Compare page throws 500 error when any branch/reference is not selected
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/compare_controller.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb
index ec02fc15d35..5f14581ac69 100644
--- a/app/controllers/projects/compare_controller.rb
+++ b/app/controllers/projects/compare_controller.rb
@@ -25,8 +25,13 @@ class Projects::CompareController < Projects::ApplicationController
end
def create
- redirect_to namespace_project_compare_path(@project.namespace, @project,
+ if params[:from].blank? || params[:to].blank?
+ flash[:alert] = "You must select from & to branches"
+ redirect_to namespace_project_compare_index_path
+ else
+ redirect_to namespace_project_compare_path(@project.namespace, @project,
params[:from], params[:to])
+ end
end
private