Permalink
Browse files

Merge pull request #10592 from arunagw/build-fix-flash-hash

Fixing build broken by this change
  • Loading branch information...
2 parents b44f086 + d63e44c commit 465e459bcc56792933c3639d40cc07f53e4d0667 @rafaelfranca rafaelfranca committed May 13, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionpack/lib/action_dispatch/middleware/flash.rb
View
4 actionpack/lib/action_dispatch/middleware/flash.rb
@@ -243,13 +243,13 @@ def call(env)
session = Request::Session.find(env) || {}
flash_hash = env[KEY]
- if flash_hash.present? || session.key?('flash')
+ if flash_hash && (flash_hash.present? || session.key?('flash'))
session["flash"] = flash_hash.to_session_value
env[KEY] = flash_hash.dup
end
if (!session.respond_to?(:loaded?) || session.loaded?) && # (reset_session uses {}, which doesn't implement #loaded?)
- session.key?('flash') && session['flash'].nil?
+ session.key?('flash') && session['flash'].nil?
session.delete('flash')
end
end

0 comments on commit 465e459

Please sign in to comment.