Commit 5dc8fe31 authored by Martin Cabrera's avatar Martin Cabrera

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

parent 6ff989cd
...@@ -25,9 +25,14 @@ class Projects::CompareController < Projects::ApplicationController ...@@ -25,9 +25,14 @@ class Projects::CompareController < Projects::ApplicationController
end end
def create def create
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, redirect_to namespace_project_compare_path(@project.namespace, @project,
params[:from], params[:to]) params[:from], params[:to])
end end
end
private private
......
---
title: Fix Compare page throws 500 error when any branch/reference is not selected
merge_request: 8492
author: Martin Cabrera
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment