Sorry for the delay in my response.
Smart cast is what Jetbrains introduced to avoid these scenarios (and others) where you get “?” question mark all around. The code don’t look good for readability, it’s not clear exactly what is happening and what happen when something is null. Doing the null check, smart cast allows you to make the code cleaner.
Hope it helps!