Skip to content

Should catch NullPointerException in FileUriUtils.getPathFromRemoteUri() #61

@himphen

Description

@himphen

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions