aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorTobias Lütke <tobias.luetke@gmail.com>2007-07-09 16:19:40 +0000
committerTobias Lütke <tobias.luetke@gmail.com>2007-07-09 16:19:40 +0000
commit124161569273e050d9e0389717cf36a491c6c119 (patch)
tree3b9e3b2d74fd1733ef7542d1905e326824f04088 /actionpack
parent3fbfc13ee35e074b3efd69c8d6dfeafd461dd43c (diff)
downloadrails-124161569273e050d9e0389717cf36a491c6c119.tar.gz
rails-124161569273e050d9e0389717cf36a491c6c119.tar.bz2
rails-124161569273e050d9e0389717cf36a491c6c119.zip
Don't blow up when using nested fields_for and the source object is nil
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7168 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index b003b69bb1..22d2984adb 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -483,7 +483,7 @@ module ActionView
end
def object
- @object || @template_object.instance_variable_get("@#{@object_name}")
+ @object || (@template_object.instance_variable_get("@#{@object_name}") rescue nil)
end
def value(object)