From 420bcf01608b0ec122312d13f683ffee7fc1383b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 28 Apr 2008 17:03:01 +0000 Subject: [PATCH] Prevent undefined method `[]' for nil:NilClass error in issues_controller.rb:140 (#1132). git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1376 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- groups/app/controllers/issues_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/groups/app/controllers/issues_controller.rb b/groups/app/controllers/issues_controller.rb index 84b95741e..322958b8c 100644 --- a/groups/app/controllers/issues_controller.rb +++ b/groups/app/controllers/issues_controller.rb @@ -137,7 +137,7 @@ class IssuesController < ApplicationController @project.custom_fields_for_issues(@issue.tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue) } : @issue.custom_values else - requested_status = IssueStatus.find_by_id(params[:issue][:status_id]) + requested_status = (params[:issue] && params[:issue][:status_id] ? IssueStatus.find_by_id(params[:issue][:status_id]) : default_status) # Check that the user is allowed to apply the requested status @issue.status = (@allowed_statuses.include? requested_status) ? requested_status : default_status @custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| CustomValue.new(:custom_field => x,