0

even though I am making favicon nullable I am getting an Illegal Argument Exception

override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
    super.onPageStarted(view, url, favicon)
    //some code 
}

Crash:

Fatal Exception: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter favicon
       at com.tv.v18.viola.setting.view.fragment.SVHelpAndLegalFragment$mWebViewClient$1.onPageStarted(SVHelpAndLegalFragment.kt)
       at com.comscore.android.vce.ai.onPageStarted()
       at com.android.webview.chromium.WebViewContentsClientAdapter.onPageStarted(WebViewContentsClientAdapter.java:531)
       at org.chromium.android_webview.AwContentsClientCallbackHelper$MyHandler.handleMessage(AwContentsClientCallbackHelper.java:157)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:7325)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Giorgos Neokleous
  • 1,709
  • 1
  • 14
  • 25
  • 2
    What's `super` in this case? And how is `onPageStarted` defined there? – Maroš Šeleng Oct 07 '19 at 10:22
  • Possible duplicate of [java.lang.IllegalArgumentException: Parameter specified as non-null is null for Kotlin and WebView](https://stackoverflow.com/questions/49323455/java-lang-illegalargumentexception-parameter-specified-as-non-null-is-null-for) – Giorgos Neokleous Oct 07 '19 at 10:23
  • Just because you let a variable be nullable doesn't mean that super.onPageStarted is prepared for it. – just_user Oct 07 '19 at 10:25
  • @GiorgosNeokleous the solution is contradiction what i have done, even though i have made favicon nullable I am still getting this crash, I am not able to understand why java is not respecting kotlin type system – ritik ranjan Sep 19 '20 at 15:18

0 Answers0