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,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
......
---
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