Skip to content

Commit fcd89ab

Browse files
committed
[GR-29706] Skips patches when the ruby home is not set
PullRequest: truffleruby/2452
2 parents 5d15e8d + fa9293b commit fcd89ab

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/truffleruby/core/CoreLibrary.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,10 @@ private ConcurrentMap<String, Boolean> initializePatching(RubyContext context) {
576576
defineModule(truffleModule, "Patching");
577577
final ConcurrentMap<String, Boolean> patchFiles = new ConcurrentHashMap<>();
578578

579-
if (context.getOptions().PATCHING) {
579+
final String rubyHome = context.getRubyHome();
580+
if (context.getOptions().PATCHING && rubyHome != null) {
580581
try {
581-
final Path patchesDirectory = Paths.get(context.getRubyHome(), "lib", "patches");
582+
final Path patchesDirectory = Paths.get(rubyHome, "lib", "patches");
582583
Files.walkFileTree(
583584
patchesDirectory,
584585
new SimpleFileVisitor<Path>() {

0 commit comments

Comments
 (0)