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

Fix caller path in the case of nil #345

Merged
merged 1 commit into from
Jul 18, 2017
Merged

Conversation

yhatt
Copy link

@yhatt yhatt commented Jul 18, 2017

We updated bullet to 5.6.0 at own project, but we have received below exception.

NoMethodError: undefined method `include?' for nil:NilClass
from /Users/yukihattori/.anyenv/envs/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bullet-5.6.0/lib/bullet/stack_trace_filter.rb:10:in `block in caller_in_project'

According to the source code of Ruby, Thread::Backtrace::Location#absolute_path seems to be able to return nil. It would become raising NoMethodError at include?. I could not find the procedure for reproducing clearly because I'm not familiar with Ruby core.

We would be able to deal with it by using to_s to convert from nil to empty string.

`Thread::Backtrace::Location#absolute_path` can return nil so it would
raise exception NoMethodError with `include?` when it returns nil.
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

Successfully merging this pull request may close these issues.

2 participants