Skip to content

Commit 5b1e3c3

Browse files
committed
Add missing null check in RubyContext#searchRubyHome
1 parent fab3933 commit 5b1e3c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/truffleruby/RubyContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ private String searchRubyHome(Options options) throws IOException {
752752
final File launcherDir = canonicalLauncherPath.getParentFile();
753753
final File candidate = launcherDir == null ? null : launcherDir.getParentFile();
754754
RubyLanguage.LOGGER.config(() -> String.format("trying home %s guessed from executable %s, as the Ruby home", candidate, options.LAUNCHER));
755-
if (isRubyHome(candidate)) {
755+
if (candidate != null && isRubyHome(candidate)) {
756756
return candidate.getCanonicalPath();
757757
} else {
758758
RubyLanguage.LOGGER.warning(String.format("home %s guessed from executable %s does not look like TruffleRuby's home", candidate, options.LAUNCHER));

0 commit comments

Comments
 (0)