Hi All! Quick question about null safety in "with"...
# random
r
Hi All! Quick question about null safety in "with" blocks. If I had a code block which looked like this:
Copy code
val myString: String? = "Hello"
with(myString) {
   println(length)
    // ... lots more use of Strings properties
}
What is the preferred way to fix the possible null reference to
length
? (I was half expecting
with(myString?) {
to work :\)