Should a String's isNullOrEmpty() count as a null ...
# getting-started
v
Should a String's isNullOrEmpty() count as a null check in an if... else block?
Copy code
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
Copy code
if(bridgeName.isNullOrEmpty())
the name length check isn't null safe.
k
See this issue, it's targeted for `1.2-Beta`: https://youtrack.jetbrains.com/issueMobile/KT-14397
v
Ah. Makes sense when you read the ticket.
k
Actually, I thought Kotlin 1.2 was already released?