Skip to content

Commit b0863be

Browse files
committed
Use use to close stream automatically
1 parent e8d4f9a commit b0863be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/test/java/at/bitfire/cert4android/CustomCertManagerTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class CustomCertManagerTest {
114114
SecureRandom()
115115
)
116116
}.socketFactory
117-
conn.inputStream.read()
117+
conn.inputStream.use { it.read() }
118118
val certs = mutableListOf<X509Certificate>()
119119
conn.serverCertificates.forEach { certs += it as X509Certificate }
120120
return certs

0 commit comments

Comments
 (0)