I've implemented a custom BaseImageDownloader, and it's method InputStream getStreamFromOtherSource(String imageUri, Object extra)
.
Everything works ok.
The thing is, some times, the file I'm opening is corrupt (out of my hands, it might happen) and I can detect when it does happen. Right now I'm returning null, and it produces a null pointer exception
ERROR/ImageLoader(21847): null
java.lang.NullPointerException
at com.nostra13.universalimageloader.utils.IoUtils.copyStream(IoUtils.java:39)
It does not break anything, since it's not closing the app, and the "fail" image is properly shown, I just don't like it throwing an exception.
Is there a proper way to handle this?