diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-11-26 16:30:44 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-11-26 16:30:44 +0000 |
commit | 9e1fb3235dbb598cbd020f715682ad6ef2248c59 (patch) | |
tree | 15d4b5692f4463cf938a636f1b2f9039e6b14512 | |
parent | 55af5952146fb9f97e8574ff751f583db4284b93 (diff) | |
download | rails-9e1fb3235dbb598cbd020f715682ad6ef2248c59.tar.gz rails-9e1fb3235dbb598cbd020f715682ad6ef2248c59.tar.bz2 rails-9e1fb3235dbb598cbd020f715682ad6ef2248c59.zip |
Handle empty cookie jars gracefully -- dont pout!
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@25 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | actionpack/lib/action_controller/cookies.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/cookies.rb b/actionpack/lib/action_controller/cookies.rb index 6630386ea6..8ce02ef78d 100644 --- a/actionpack/lib/action_controller/cookies.rb +++ b/actionpack/lib/action_controller/cookies.rb @@ -36,7 +36,7 @@ module ActionController #:nodoc: # Returns the value of the cookie by +name+ -- or nil if no such cookie exist. You set new cookies using either the cookie method # or cookies[]= (for simple name/value cookies without options). def [](name) - @cookies[name.to_s].value if @cookies[name.to_s] + @cookies[name.to_s].value if @cookies.is_a?(Hash) && @cookies[name.to_s] end def []=(name, options) |