getting null pointer exception cause an image online goes away btwn checking and loading
in
Programming Questions
•
1 year ago
I am loading images from the net, many many many of them, from instagram, and checking to make sure the URL is valid before loading the image, but once in a great while, in between checking for null and loading the image, the image is removed from the URL. quite a doozy. I had a workaround but it seems to invoke a memory leak in PImage, therefore crashing the app after 20 minutes or so.
any thoughts on how to avoid this bug? anyone even understand what I'm talking about?
- if (loadImage(photo_urls[x]) != null) {
- image(loadImage(photo_urls[x]), ((x)*width/5), 0, width/5, height);
- }
1