Skip to content

Commit

Permalink
Rewrite Try as try-finally
Browse files Browse the repository at this point in the history
  • Loading branch information
laughedelic committed Apr 12, 2018
1 parent 1cf42f6 commit ea5c625
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ object SbtServer extends LazyLogging {
val path = cwd.resolve("project").resolve("build.properties")
if (path.isFile) {
val input = Files.newInputStream(path.toNIO)
Try { props.load(input) }
input.close()
try {
props.load(input)
} finally {
input.close()
}
}
Option(props.getProperty("sbt.version"))
}
Expand Down

0 comments on commit ea5c625

Please sign in to comment.