Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It will caused NullPointException if we implement the interface of 'PretreatmentService' with Kotlin language #1055

Open
ShenghuaLuo opened this issue Sep 21, 2023 · 0 comments

Comments

@ShenghuaLuo
Copy link

Issue

  • → Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter context
    at com.companyA.moduleB.PretreatmentServiceImpl.onPretreatment(Unknown Source:2)
    at com.alibaba.android.arouter.launcher._ARouter.navigation(_ARouter.java:286)
    at com.alibaba.android.arouter.launcher.ARouter.navigation(ARouter.java:186)
    at com.alibaba.android.arouter.facade.Postcard.navigation(Postcard.java:148)
    at com.alibaba.android.arouter.facade.Postcard.navigation(Postcard.java:139)
    at com.alibaba.android.arouter.facade.Postcard.navigation(Postcard.java:130)
    at com.alibaba.android.arouter.launcher._ARouter.afterInit(_ARouter.java:247)
    at com.alibaba.android.arouter.launcher.ARouter.init(ARouter.java:46)
    at com.greendot.core.router.Router.init(Router.kt:20)

Version

  • → Latest Version 1.5.2

Case

  • → It will caused NullPointException if we implement the interface of 'PretreatmentService' with Kotlin language and parameter type without '?' like this:
    image

Actually

image

Suggestion ?

  1. Whether the parameter 'context' should be removed from interface of 'PretreatmentService' due to it existed at 'init' function ?
  2. Or whether the parameter 'context' should be checked before passing ?
    image

##Finally

  • →Looking forward to your evaluation and updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant