Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unauthorized error to_s breaks if request is nil #165

Closed
rhymes opened this issue Apr 8, 2020 · 0 comments
Closed

Unauthorized error to_s breaks if request is nil #165

rhymes opened this issue Apr 8, 2020 · 0 comments

Comments

@rhymes
Copy link

rhymes commented Apr 8, 2020

According to

class Unauthorized < OAuth::Error
attr_reader :request
def initialize(request = nil)
@request = request
end
def to_s
[request.code, request.message] * " "
end
end

the argument request defaults to nil, but if called with nil, .to_s will break with

     NoMethodError:
       undefined method `code' for nil:NilClass
@rhymes rhymes changed the title Unauthorized's breaks if request is nil Unauthorized error to_s breaks if request is nil Apr 8, 2020
pboling added a commit that referenced this issue Oct 31, 2021
…roblem

🐛 Closes #165: NoMethodError on nil request
pboling added a commit that referenced this issue Nov 1, 2021
Signed-off-by: Peter Boling <peter.boling@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant