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

KotlinNullPointerException in RxImagePicker::onImagePicked #70

Open
yaroslav-android opened this issue Nov 1, 2021 · 0 comments
Open

Comments

@yaroslav-android
Copy link

yaroslav-android commented Nov 1, 2021

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

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