Treat empty property values as empty list, not as list of an empty string.

This commit is contained in:
Alexander Gorshenev
2017-10-16 17:17:12 +03:00
committed by alexander-gorshenev
parent ddf8d4cc4d
commit 11a11378ff
@@ -48,6 +48,8 @@ fun Properties.propertyString(key: String, suffix: String? = null): String?
*/
fun Properties.propertyList(key: String, suffix: String? = null): List<String> {
val value = this.getProperty(key.suffix(suffix)) ?: this.getProperty(key)
if (value?.isBlank() == true) return emptyList()
return value?.split(' ') ?: emptyList()
}