From 11b1ebe606a82bcdcb4ff5568f0302c5470d0048 Mon Sep 17 00:00:00 2001 From: Christian Boos Date: Wed, 29 Dec 2021 22:10:21 +0000 Subject: [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 --- lib/error_highlight/core_ext.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/error_highlight') 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 = {} -- cgit v1.2.3