summaryrefslogtreecommitdiffstats
path: root/app/controllers/users_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-29 17:07:28 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-29 17:07:28 +0000
commitc8b3c8dfec4c768658be5482234c7a05808e6963 (patch)
tree16862470de00f6ce378d9303eb82cb37c1dd3ab0 /app/controllers/users_controller.rb
parent603e11d7a5aa62f923e7b013cac6c66462131232 (diff)
downloadredmine-c8b3c8dfec4c768658be5482234c7a05808e6963.tar.gz
redmine-c8b3c8dfec4c768658be5482234c7a05808e6963.zip
Fix: error when posting to projects/add or users/add with no custom_fields parameter.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@675 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r--app/controllers/users_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 7e3abc75c..85579820f 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -58,7 +58,7 @@ class UsersController < ApplicationController
@user.admin = params[:user][:admin] || false
@user.login = params[:user][:login]
@user.password, @user.password_confirmation = params[:password], params[:password_confirmation] unless @user.auth_source_id
- @custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user, :value => params["custom_fields"][x.id.to_s]) }
+ @custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user, :value => (params[:custom_fields] ? params["custom_fields"][x.id.to_s] : nil)) }
@user.custom_values = @custom_values
if @user.save
Mailer.deliver_account_information(@user, params[:password]) if params[:send_information]