https://kotlinlang.org logo
Title
v

v79

08/10/2017, 7:27 PM
Should a String's isNullOrEmpty() count as a null check in an if... else block?
if(bridgeName == null || bridgeName.isEmpty()) {
			errors.put("add-search-name","Name must not be blank")
		} else {
			if(4 > bridgeName.length) {

			}
works fine, but if I replace the if condition with
if(bridgeName.isNullOrEmpty())
the name length check isn't null safe.
k

karelpeeters

08/10/2017, 9:02 PM
See this issue, it's targeted for `1.2-Beta`: https://youtrack.jetbrains.com/issueMobile/KT-14397
v

v79

08/10/2017, 9:09 PM
Ah. Makes sense when you read the ticket.
k

karelpeeters

08/10/2017, 9:11 PM
Actually, I thought Kotlin 1.2 was already released?