rails/rails — pull request #12279 by jbaudanza (2013-09-19 02:15:05+00:00)
Title: Calling reset_session inside of a controller with a NullSessionHash raises a nil exception.

For example:

```ruby
class StudentInvitationsController < ApplicationController
protect_from_forgery :with => :null_session

# Posting to this action with an invalid authenticity token will raise an exception.
def create
reset_session
end
end
```

Raising the following:

```
NoMethodError: undefined method `destroy_session' for nil:NilClass
/Users/jon/.rvm/gems/ruby-1.9.2-p180/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:85:in `destroy'
/Users/jon/work/rails/actionpack/lib/action_dispatch/http/request.rb:257:in `reset_session'
/Users/jon/work/rails/actionpack/lib/action_controller/metal/rack_delegation.rb:22:in `reset_session'
/Users/jon/work/rails/actionpack/test/controller/request_forgery_protection_test.rb:83:in `try_to_reset_session'
/Users/jon/work/rails/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
```

I've included a simple fix and a test case.