HBiSoft / PickiT

An Android library that returns real paths from Uri's
MIT License
292 stars 54 forks source link

Crash:DownloadAsyncTask.java:84 #33

Closed singhsandip closed 3 years ago

singhsandip commented 3 years ago

Hi, massive thanks for this library, I have an issue in DownloadAsyncTask class

Caused by java.lang.IllegalStateException Couldn't read row 0, col -1 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it. com.hbisoft.pickit.DownloadAsyncTask.doInBackground

Screenshot from 2020-12-09 11-10-27

HBiSoft commented 3 years ago

This doesn't make sense at all. The crash is pointing to:

https://github.com/HBiSoft/PickiT/blob/65a5dde9d84884e84d0cf084f62d3de2c229c365/pickit/src/main/java/com/hbisoft/pickit/DownloadAsyncTask.java#L84

It says Make sure the Cursor is initialized correctly before accessing data from it. but I have the following:

https://github.com/HBiSoft/PickiT/blob/65a5dde9d84884e84d0cf084f62d3de2c229c365/pickit/src/main/java/com/hbisoft/pickit/DownloadAsyncTask.java#L79-L89

Note that it is in a try/catch so it should not throw an exception. I also check if the cursor is null:

https://github.com/HBiSoft/PickiT/blob/65a5dde9d84884e84d0cf084f62d3de2c229c365/pickit/src/main/java/com/hbisoft/pickit/DownloadAsyncTask.java#L80


I can't see how it's possible to throw an IllegalStateException.

Please ensure that you have the latest version. Try and reproduce the crash and provide the entire log. Also, provide the device detail.

HBiSoft commented 3 years ago

No response, closing.