diff --git a/app/controllers/risks_controller.rb b/app/controllers/risks_controller.rb index 35a45d0..7a43ab3 100644 --- a/app/controllers/risks_controller.rb +++ b/app/controllers/risks_controller.rb @@ -129,7 +129,7 @@ def destroy flash[:notice] = l(:notice_risk_successful_delete) respond_to do |format| - format.html { redirect_back_or_default project_risks_path(@project) } + format.html { redirect_back_or_default(@project ? project_risks_path(@project) : nil) } format.api { render_api_ok } end end @@ -196,7 +196,7 @@ def bulk_update flash[:notice] = l(:notice_risk_successful_update) unless risks_saved.empty? end - redirect_back_or_default project_risks_path(@project) + redirect_back_or_default(@project ? project_risks_path(@project) : nil) end private