summaryrefslogtreecommitdiffstats
path: root/app/controllers/issues_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-17 20:20:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-17 20:20:59 +0000
commitb4cf4fca9d5b5aacd05af33a3be00be213cd893d (patch)
treeda5cdba41755a1d5b6538f179df35fafd0bdb3d3 /app/controllers/issues_controller.rb
parent8b994475c482263693e5ec517a5f663680174e20 (diff)
downloadredmine-b4cf4fca9d5b5aacd05af33a3be00be213cd893d.tar.gz
redmine-b4cf4fca9d5b5aacd05af33a3be00be213cd893d.zip
Fixed an error when trying to copy an issue that does not exist.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8670 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issues_controller.rb')
-rw-r--r--app/controllers/issues_controller.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 358faf507..82fa5f8ea 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -360,7 +360,12 @@ private
def build_new_issue_from_params
if params[:id].blank?
@issue = Issue.new
- @issue.copy_from(params[:copy_from]) if params[:copy_from]
+ begin
+ @issue.copy_from(params[:copy_from]) if params[:copy_from]
+ rescue ActiveRecord::RecordNotFound
+ render_404
+ return
+ end
@issue.project = @project
else
@issue = @project.issues.visible.find(params[:id])