Skip to content

Commit

Permalink
Better nil guards from calling cookie value on nil or string
Browse files Browse the repository at this point in the history
  • Loading branch information
Russell Osborne committed Jan 19, 2021
1 parent 46a582f commit 6a01657
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/impressionist_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def session_hash
id = request.session_options[:id]
end

unless id.is_a? String
if id.respond_to?(:cookie_value)
id = id.cookie_value if Rack::Session::SessionId.const_defined?(:ID_VERSION) && Rack::Session::SessionId::ID_VERSION == 2
end

Expand Down

0 comments on commit 6a01657

Please sign in to comment.