diff --git a/src/main/kotlin/com/haulmont/cuba/cli/Messages.kt b/src/main/kotlin/com/haulmont/cuba/cli/Messages.kt index 57e72bd..88910a2 100644 --- a/src/main/kotlin/com/haulmont/cuba/cli/Messages.kt +++ b/src/main/kotlin/com/haulmont/cuba/cli/Messages.kt @@ -33,7 +33,7 @@ class Messages(clazz: Class<*>, messagesFileName: String = "messages.properties" }.let { clazz.getResource(it)?.openStream()?.reader() ?: throw RuntimeException("Unable to find messages file $messagesFileName for $clazz") - }.let { reader -> + }.use { reader -> Properties().apply { load(reader) }