Merge pull request #715 from KimJungHun/patch-1

Update agents_controller.rb

Andrew Cantino 10 years ago
parent
commit
cc9680f045
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/controllers/agents_controller.rb

+ 1 - 1
app/controllers/agents_controller.rb

@@ -179,7 +179,7 @@ class AgentsController < ApplicationController
179 179
 
180 180
   # Sanitize params[:return] to prevent open redirect attacks, a common security issue.
181 181
   def redirect_back(message)
182
-    if params[:return] == "show" && @agent
182
+    if params[:return] == "show" && @agent && !@agent.destroyed?
183 183
       path = agent_path(@agent)
184 184
     elsif params[:return] =~ /\A#{Regexp::escape scenarios_path}\/\d+\Z/
185 185
       path = params[:return]