The missing ? trap in Kotlin

Beware of this trap. Check out the below seemingly improved Kotlin code
// Original code
if (someObject != null && status) {
doThis()
}// Improve code (but return wrong result!!)
someObject?.takeIf{ status }.apply{ doThis() }
What’s wrong with the code? Note: there is no compile error and it is still executable (no Null Pointer Exception as well).