-
- Downloads
Make checks for continue_params more robust
The check for continue_params&.key?(:to) in Projects::ImportsController caused an exception in redirect_to if this key contained a nil value. Since url_for won't add any params for an empty hash, we can just return that in continue_params if params[:continue] isn't present, and simplify the code in the controllers to check for the values we actually want to use.
Showing
- app/controllers/concerns/continue_params.rb 1 addition, 1 deletionapp/controllers/concerns/continue_params.rb
- app/controllers/projects/forks_controller.rb 7 additions, 11 deletionsapp/controllers/projects/forks_controller.rb
- app/controllers/projects/imports_controller.rb 2 additions, 6 deletionsapp/controllers/projects/imports_controller.rb
- app/controllers/projects/jobs_controller.rb 1 addition, 1 deletionapp/controllers/projects/jobs_controller.rb
- spec/controllers/concerns/continue_params_spec.rb 8 additions, 0 deletionsspec/controllers/concerns/continue_params_spec.rb
Please register or sign in to comment