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

with binding_of_caller installed, errors in certain filetypes cause NoMethodError for nil:NilClass errors #12

Closed
joshskeen opened this issue Dec 9, 2012 · 2 comments
Labels

Comments

@joshskeen
Copy link

for example, an error in a .scss file caused a undefined method `[]' for nil:NilClass error:

better_errors (0.0.7) lib/better_errors/error_frame.rb:7:in `block in from_exception'
better_errors (0.0.7) lib/better_errors/error_frame.rb:4:in `each'
better_errors (0.0.7) lib/better_errors/error_frame.rb:4:in `each_with_index'
better_errors (0.0.7) lib/better_errors/error_frame.rb:4:in `each'
better_errors (0.0.7) lib/better_errors/error_frame.rb:4:in `map'
better_errors (0.0.7) lib/better_errors/error_frame.rb:4:in `from_exception'
better_errors (0.0.7) lib/better_errors/error_page.rb:58:in `backtrace_frames'

changing line 6 of error_frame.rb to:

if BetterErrors.binding_of_caller_available? && exception.__better_errors_bindings_stack

avoids this, but i'm not sure if that's the best fix for the problem. It might be better if binding_of_caller were disabled altogether in this case.

@joshskeen
Copy link
Author

👍

@billhorsman
Copy link

I just upgraded and have replaced "undefined method `[]' for nil:NilClass error" with a beautiful, helpful screen showing me the problem. Frustration gone! Brilliant. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants