Skip to content

KotlinNullPointerException in RxImagePicker::onImagePicked #70

Description

@ardiien

I recommend not using force unwrap in your libs. When you take photos for some reason on some devices it can return Uri null and in your onImagePicked method it crashes on line 242.

241    private fun onImagePicked(uri: Uri?) {
242        publishSubject.onNext(uri!!)
243        publishSubject.onComplete()
244    }

Fatal Exception: java.lang.RuntimeExceptionUnable to resume activity {com.example.application/com.example.application.presentation.settings.image_setup.ProfileImageSetupScreen}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=196709, result=-1, data=null} to activity {com.example.application/com.example.application.presentation.settings.image_setup.ProfileImageSetupScreen}: kotlin.KotlinNullPointerExceptioncom.mlsdev.rximagepicker.RxImagePicker.onImagePicked (RxImagePicker.java:242)com.mlsdev.rximagepicker.RxImagePicker.onActivityResult (RxImagePicker.java:90)androidx.fragment.app.FragmentActivity.onActivityResult (FragmentActivity.java:170)com.example.application.presentation.settings.image_setup.ProfileImageSetupScreen.onActivityResult (ProfileImageSetupScreen.java:91)

occurs on Android 10-11
Samsung, Motorola, LGE

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions