Skip to content

Commit

Permalink
backtrace can be nil.
Browse files Browse the repository at this point in the history
Surprisingly, on SystemStackError#backtrace can return nil.
  • Loading branch information
ko1 committed Jul 31, 2019
1 parent efac0a2 commit cac44de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tool/lib/minitest/unit.rb
Expand Up @@ -984,6 +984,9 @@ def record suite, method, assertions, time, error

def location e # :nodoc:
last_before_assertion = ""

return '<empty>' unless e.backtrace # SystemStackError can return nil.

e.backtrace.reverse_each do |s|
break if s =~ /in .(assert|refute|flunk|pass|fail|raise|must|wont)/
last_before_assertion = s
Expand Down

0 comments on commit cac44de

Please sign in to comment.