<@U3K6VQZLJ> No, probably because the compiler can...
# announcements
k
@eygraber No, probably because the compiler can't be 100% sure that method guarantees that name isn't null, because the runtime implementation could theoretically be different from the one the compiler can see. (this isn't the case, it's an inline function) A quick fix would be to add another null check:
Copy code
var a: String? = "hey"

var b: String =
if (a.isNullOrEmpty() || a == null) {
    "empty"
}
else {
    a
}