NPE accessing variable that should have been resolved to non-null


#1

Hi,

I’m still having a problem with an unknown NPE. I have attached the full source file and the full crash/exception report. Sometimes the console has not just the exception but a big Android runtime error report, which I have included.

The code at NavigationDrawerManager.kt:51, which is the top of the stack trace, calls a function on a local variable that has been guarded from null by check and return in the function. So, it seems like the generated code is incorrect. Also, why doesn’t the crash happen at 48 as it accesses the same object?NavigationDrawerManager.kt.zip (1.8 KB)
full android error.txt.xml (53.5 KB)

Also, it does seem that the problem is affected by the lazy code for navigationView property.

Would you like me to report isue in YT?