Skip to content

Commit

Permalink
Kept getting this in our errors, under Self.Errbit rather than for ou…
Browse files Browse the repository at this point in the history
…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
neuroalien committed Apr 29, 2012
1 parent 3bfad3d commit 3bcc3e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/notice.rb
Expand Up @@ -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)
Expand Down

0 comments on commit 3bcc3e3

Please sign in to comment.