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

Should catch NullPointerException in FileUriUtils.getPathFromRemoteUri() #61

Closed
himphen opened this issue Mar 5, 2020 · 0 comments
Closed
Milestone

Comments

@himphen
Copy link

himphen commented Mar 5, 2020

For some reasons, in FileUriUtils.getPathFromRemoteUri(), FileUtil.getImageFile(context.cacheDir, extension) returned null and null is passed into FileOutputStream(@NonNull File file). In my case, user choose a file from content://com.microsoft.skydrive.content.StorageAccessProvider.

It may be caused NullPointerException and please consider checking file != null. Thank you.

Caused by java.lang.NullPointerException
       at com.github.dhaval2404.imagepicker.util.FileUriUtils.getPathFromRemoteUri(FileUriUtils.java:158)
       at com.github.dhaval2404.imagepicker.util.FileUriUtils.getRealPath(FileUriUtils.java:31)
       at com.github.dhaval2404.imagepicker.provider.GalleryProvider.handleResult(GalleryProvider.java:102)
       at com.github.dhaval2404.imagepicker.provider.GalleryProvider.onActivityResult(GalleryProvider.java:89)
       at com.github.dhaval2404.imagepicker.ImagePickerActivity.onActivityResult(ImagePickerActivity.java:133)
Dhaval2404 added a commit that referenced this issue Mar 12, 2020
Added null check for file to avoid NullPointerException

#61
@Dhaval2404 Dhaval2404 added this to the v1.7 milestone Mar 12, 2020
Dhaval2404 added a commit that referenced this issue Mar 25, 2020
v1.7 Released

	- Added option to limit MIME types while choosing a gallery image (Special Thanks to [Marchuck](https://github.com/Marchuck))
	- Introduced ImageProviderInterceptor, Can be used for analytics (Special Thanks to [Marchuck](https://github.com/Marchuck))
	- Fixed FileProvider of the library clashes with the FileProvider of the app [#51](#51) (Special Thanks to [OyaCanli](https://github.com/OyaCanli))
	- Added option to set Storage Directory [#52](#52)
	- Fixed NullPointerException in FileUriUtils.getPathFromRemoteUri()  [#61](#61) (Special Thanks to [himphen](https://github.com/himphen))
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

2 participants