diff options
author | Christian Boos <cboos@bct-technology.com> | 2021-12-29 22:10:21 +0000 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-01-04 23:09:01 +0900 |
commit | 11b1ebe606a82bcdcb4ff5568f0302c5470d0048 (patch) | |
tree | db792ed39b08e46eae1793c52097d27dfb17b2ec /lib/error_highlight | |
parent | e22218b510ec6befb385a6dda92d4a178607ebc7 (diff) |
[ruby/error_highlight] Fix the spurious TypeError.
When we have no backtrace locations, we can't have the highlight,
so just return the message.
https://github.com/ruby/error_highlight/commit/9f5c639494
Diffstat (limited to 'lib/error_highlight')
-rw-r--r-- | lib/error_highlight/core_ext.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/error_highlight/core_ext.rb b/lib/error_highlight/core_ext.rb index d3a4dbacd6..78cda8ace2 100644 --- a/lib/error_highlight/core_ext.rb +++ b/lib/error_highlight/core_ext.rb @@ -15,6 +15,7 @@ module ErrorHighlight return msg unless locs loc = locs.first + return msg unless loc begin node = RubyVM::AbstractSyntaxTree.of(loc, keep_script_lines: true) opts = {} |