I have a DialogFragment
subclass that I'm using, and I'm getting some crashes when it's dismissed. It doesn't happen every time, and I can't seem to find a pattern to it. The crash is happening inside the overridden onDismiss()
function.
java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter dialog
at com.foo.MyDialogFragment.onDismiss(Unknown Source:2)
This is the DialogInterface
parameter, and it is happening before any of my code runs, so I cannot do anything to prevent it. I cannot make the parameter dialog
nullable, as that breaks the contract with DialogFragment
and it won't compile.
Any idea what is causing this, and more importantly, what can I do? It seems like this should not ever be happening, but here I am.