NullPointerException in ImageWrapper #57

Closed
shrift opened this Issue Sep 6, 2012 · 2 comments

Projects

None yet

4 participants

@shrift

Hello, thanks for this helpful library!

I am using the 1.5.6 jar I downloaded from maven central.

Here's the stack trace:
E/AndroidRuntime(15149): FATAL EXCEPTION: main
E/AndroidRuntime(15149): java.lang.NullPointerException
E/AndroidRuntime(15149): at com.novoda.imageloader.core.model.ImageWrapper.getCurrentUrl(ImageWrapper.java:62)
E/AndroidRuntime(15149): at com.novoda.imageloader.core.loader.util.LoaderTask.hasImageViewUrlChanged(LoaderTask.java:126)
E/AndroidRuntime(15149): at com.novoda.imageloader.core.loader.util.LoaderTask.onPostExecute(LoaderTask.java:145)
E/AndroidRuntime(15149): at com.novoda.imageloader.core.loader.util.LoaderTask.onPostExecute(LoaderTask.java:29)
E/AndroidRuntime(15149): at com.novoda.imageloader.core.loader.util.AsyncTask.finish(AsyncTask.java:451)
E/AndroidRuntime(15149): at com.novoda.imageloader.core.loader.util.AsyncTask.access$300(AsyncTask.java:151)
E/AndroidRuntime(15149): at com.novoda.imageloader.core.loader.util.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:463)
E/AndroidRuntime(15149): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(15149): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(15149): at android.app.ActivityThread.main(ActivityThread.java:4928)
E/AndroidRuntime(15149): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(15149): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(15149): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime(15149): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
E/AndroidRuntime(15149): at dalvik.system.NativeStart.main(Native Method)

@luigi-agosti

um strange, I need to double check
are you in any case removing the tag from the ImageView or not setting it at all?

I will probably add a check for it, as I don't want it to fail with a NPE though,
it will be good if you check how you are managing the tags on ImageViews

@shrift

Yes, I do set a null tag if the listview row containing the ImageView is recycled, or as an effort to "cancel" any further processing of an incoming image for that imageview... I couldn't find any actual cancel methods for an in progress image load, so as an effort to ensure that at the very least the image didn't get displayed when I didn't want it any longer I set the tag to null.

@ouchadam ouchadam added a commit that referenced this issue Sep 27, 2012
@ouchadam ouchadam fix for issue #57 7e515c1
@ouchadam ouchadam added a commit that referenced this issue Sep 27, 2012
@ouchadam ouchadam resolves #23 #57 , minor refactoring 4b47bef
@ouchadam ouchadam closed this Sep 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment