Fix Compare page throws 500 error when any branch/reference is not selected

This commit is contained in:
Martin Cabrera 2017-01-10 23:11:36 +01:00
parent 6ff989cd6d
commit 5dc8fe31ba
2 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -0,0 +1,4 @@
---
title: Fix Compare page throws 500 error when any branch/reference is not selected
merge_request: 8492
author: Martin Cabrera