Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Kept getting this in our errors, under Self.Errbit rather than for ou…

…r app:

NoMethodError: undefined method `[]' for nil:NilClass
tracing to [PROJECT_ROOT]/app/models/notice.rb:127 → block in sanitize
Looks like line can be nil, in which case line['blabla'] will make a SNAFU. A test for line not nil seemed the cheapest solution here.
  • Loading branch information...
commit 3bcc3e314bfc3e5565c7372243a27484b3a905b3 1 parent 3bfad3d
@CristinaRO authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  app/models/notice.rb
View
2  app/models/notice.rb
@@ -124,7 +124,7 @@ def sanitize
send("#{h}=",sanitize_hash(send(h)))
end
# Set unknown backtrace files
- backtrace.each{|line| line['file'] = "[unknown source]" if line['file'].blank? }
+ backtrace.each{|line| line['file'] = "[unknown source]" if line && line['file'].blank? }
end
def sanitize_hash(h)
Please sign in to comment.
Something went wrong with that request. Please try again.