mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Handle empty cookie jars gracefully -- dont pout!
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@25 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
55af595214
commit
9e1fb3235d
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue