r/mAndroidDev • u/programadorthi • Mar 23 '26
Billion Dollar Mistake Null also Null
Kotlin is really a null-safety language. It allows you create a silent bug that should be avoided:
null.also {
println("Hello production silent null bug")
}
0
Upvotes
7
u/pcoyuncy Mar 23 '26
What is the bug here?
2
u/Zhuinden DDD: Deprecation-Driven Development Mar 24 '26
I mean do
null?.if you don't want that8
u/JacksOnF1re Mar 23 '26
ππ΄ββοΈ
π²π€ΈββοΈ
π²π
5
u/Opulence_Deficit You will pry XML views from my cold dead hands Mar 23 '26
Thank you for not using
let2
u/Fair-Degree-2200 null!! Mar 23 '26
alsois an extension fun on a generic type with no bounds (so nullable is allowed).Β0
u/abandonedmuffin Mar 23 '26
Lol βalsoβ serves a different purpose π€£