Assertion
suggest changeThe !! suffix ignores nullability and returns a non-null version of that type. NullPointerException is thrown if the value is null.
val message: String? = null
println(message!!) // NullPointerException thrown, app crashes
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents