Skip to content

Commit 3314be7

Browse files
committed
closing BufferedReader after reading raw schema json
1 parent 78f8b48 commit 3314be7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/com/github/erosb/jsonsKema/SchemaClient.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fun interface SchemaClient {
4444
fun getParsed(uri: URI): IJsonValue {
4545
try {
4646
val reader = BufferedReader(InputStreamReader(get(uri)))
47-
return JsonValue.parse(reader.readText(), uri)
47+
return reader.use { JsonValue.parse(it.readText(), uri) }
4848
} catch (ex: UncheckedIOException) {
4949
throw SchemaDocumentLoadingException(uri, ex)
5050
} catch (ex: JsonParseException) {

0 commit comments

Comments
 (0)