Fix `BacktraceFormatter` to handle `nil` backtraces.
Created by: myronmarston
Exception.new.backtrace
is nil
so we can't count on
there always being a backtrace. Before now we relied
on the format_backtrace
caller handling this (passing
ex.backtrace || []
), but with #2074 now also including
the exception.cause
in failure output, the code there
did not guard the format_backtrace
call with || []
and is causing users to get a NoMethodError
. It's
easiest if format_backtrace just handles the
nil` case
so each caller does not have to remember to handle it.
Fixes #2117 (closed).