Skip to content

Commit

Permalink
Properly close reading Stream
Browse files Browse the repository at this point in the history
Signed-off-by: TheSilkMiner <thesilkminer@outlook.com>
  • Loading branch information
TheSilkMiner authored and jaredlll08 committed Oct 11, 2022
1 parent e7eb8b4 commit 320c10a
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -72,7 +72,9 @@ static ScriptFile of(final Path baseDirectory, final Path file, final RunInfo in
throw new IllegalArgumentException("File " + file + " is not contained within " + baseDirectory);
}
final String name = baseDirectory.toAbsolutePath().relativize(file.toAbsolutePath()).toString();
return of(name, lines(file), info, preprocessors);
try(final Stream<String> lines = lines(file)) {
return of(name, lines, info, preprocessors);
}
}

private static boolean verifyChild(final Path parent, final Path file) {
Expand Down

0 comments on commit 320c10a

Please sign in to comment.