Permalink
Browse files

Ensure session responds to destroy before calling it.

  • Loading branch information...
1 parent 6b00e8e commit 6e1410db89fc83a1603937a18774f728e713debd @josevalim josevalim committed Nov 20, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_dispatch/http/request.rb
@@ -216,7 +216,7 @@ def body_stream #:nodoc:
# TODO This should be broken apart into AD::Request::Session and probably
# be included by the session middleware.
def reset_session
- session.destroy if session
+ session.destroy if session && session.respond_to?(:destroy)
self.session = {}
@env['action_dispatch.request.flash_hash'] = nil
end

0 comments on commit 6e1410d

Please sign in to comment.