https://kotlinlang.org logo
Title
k

Kaushik

05/25/2020, 8:32 AM
Hi, Any one help me how to fix this issue. Thanks in advance. Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'void android.os.Parcelable.writeToParcel(android.os.Parcel, int)' on a null object reference This is happening in kotlin model class
s

sasikanth

05/25/2020, 3:09 PM
Is the
data class
object nullable?
k

Kaushik

05/25/2020, 3:25 PM
No
s

sasikanth

05/25/2020, 4:21 PM
You might be receiving a null object for the
data class
even though it's not marked as nullable.
h

henrikhorbovyi

05/25/2020, 5:01 PM
Can you show us your code?
k

Kaushik

05/26/2020, 6:53 AM
I'm able to reproduce the issue now. I'm parsing one model class from fragment A to B by bundle putparcelable..now if I minimise the app that time it's crashing