Skip to content

Commit

Permalink
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -129,12 +129,15 @@ public EmbedEvalUnit parse(PathType type, String filename, int... lines) {
break;
case CLASSPATH:
URL loc = container.getProvider().getRuntime().getJRubyClassLoader().getResource(filename);
filename = LoadService.classpathFilenameFromURL(filename, loc, true);
try {
istream = loc.openStream();
} catch (IOException ioe) {
// should not happen
throw new ParseFailedException(ioe);
if (loc == null) {
istream = null; // as in ClassLoader.getResourceAsStream
} else {
filename = LoadService.classpathFilenameFromURL(filename, loc, true);
try {
istream = loc.openStream();
} catch (IOException ioe) {
istream = null; // as in getClassLoader.getResourceAsStream
}
}
break;
}

0 comments on commit 5a4bcb2

Please sign in to comment.