Skip to content

Commit e230071

Browse files
committed
Using checkNotNull
Signed-off-by: Arnau Mora Gras <[email protected]>
1 parent 88d5c1c commit e230071

File tree

1 file changed

+1
-3
lines changed
  • src/main/kotlin/com/arnyminerz/escalaralcoiaicomtat/backend/system

1 file changed

+1
-3
lines changed

src/main/kotlin/com/arnyminerz/escalaralcoiaicomtat/backend/system/Package.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ object Package {
88
*/
99
fun getVersion(): String {
1010
val version: String = this::class.java.getResourceAsStream("/version.txt").use { input ->
11-
if (input == null) {
12-
throw IllegalStateException("Version file not found")
13-
}
11+
checkNotNull(input) { "Version file not found" }
1412
input.bufferedReader().readText()
1513
}
1614
return version

0 commit comments

Comments
 (0)