Skip to content

private method `gsub' called for nil:NilClass #20

@CloCkWeRX

Description

@CloCkWeRX

In 2.3.9, under some circumstances it's possible to trigger the above error.

A NoMethodError occurred in agc#logout:

private method gsub' called for nil:NilClass /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/1.8/cgi.rb:342:inescape'
vendor/bundle/ruby/1.8/gems/rubycas-client-2.3.9/lib/casclient/client.rb:285:in hash_to_query' vendor/bundle/ruby/1.8/gems/rubycas-client-2.3.9/lib/casclient/client.rb:285:ineach'
vendor/bundle/ruby/1.8/gems/rubycas-client-2.3.9/lib/casclient/client.rb:285:in hash_to_query' vendor/bundle/ruby/1.8/gems/rubycas-client-2.3.9/lib/casclient/client.rb:283:ineach'
vendor/bundle/ruby/1.8/gems/rubycas-client-2.3.9/lib/casclient/client.rb:283:in hash_to_query' vendor/bundle/ruby/1.8/gems/rubycas-client-2.3.9/lib/casclient/client.rb:96:inlogout_url'
vendor/gems/rubycas-client-rails/lib/rubycas-client-rails.rb:234:in logout' lib/ruby_cas_proxy.rb:9:inlogout'
app/controllers/agc/agc_controller.rb:13:in `logout'

It looks like https://github.com/rubycas/rubycas-client/blob/v2.3.9/lib/casclient/client.rb#L281 is somehow getting a destination_url which, when parsed, has Nil elements.

Users are typically coming from URIs like:
https://foo.com/path/to/page?&sort=date_received.DESC

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions