Skip to content

Commit 778b89b

Browse files
committed
Use helper method to check if a SourceSection is available
1 parent 2dc1294 commit 778b89b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/truffleruby/core/module/ModuleNodes.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
import org.truffleruby.language.arguments.ReadPreArgumentNode;
7878
import org.truffleruby.language.arguments.ReadSelfNode;
7979
import org.truffleruby.language.arguments.RubyArguments;
80+
import org.truffleruby.language.backtrace.BacktraceFormatter;
8081
import org.truffleruby.language.constants.GetConstantNode;
8182
import org.truffleruby.language.constants.LookupConstantInterface;
8283
import org.truffleruby.language.constants.LookupConstantNode;
@@ -1115,7 +1116,7 @@ private Object getLocation(ConstantLookupResult lookupResult) {
11151116
}
11161117

11171118
final SourceSection sourceSection = lookupResult.getConstant().getSourceSection();
1118-
if (sourceSection == null || !sourceSection.isAvailable()) {
1119+
if (!BacktraceFormatter.isAvailable(sourceSection)) {
11191120
return createEmptyArray();
11201121
} else {
11211122
final RubyString file = makeStringNode.executeMake(

0 commit comments

Comments
 (0)