Skip to content

Commit

Permalink
NPE fix. I believe you had your if-else the wrong way round, tests se…
Browse files Browse the repository at this point in the history
…em to infer this
  • Loading branch information
Blundell committed Nov 13, 2012
1 parent 5611d55 commit fee1cc5
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -18,15 +18,15 @@
import android.graphics.Bitmap;
import android.util.Log;
import android.widget.ImageView;

import com.novoda.imageloader.core.LoaderContext;
import com.novoda.imageloader.core.exception.ImageNotFoundException;
import com.novoda.imageloader.core.loader.util.LoaderTask;
import com.novoda.imageloader.core.model.ImageTag;
import com.novoda.imageloader.core.model.ImageWrapper;

public class ConcurrentLoader implements Loader {

private LoaderContext loaderContext;
private final LoaderContext loaderContext;

public ConcurrentLoader(LoaderContext loaderContext) {
this.loaderContext = loaderContext;
Expand Down Expand Up @@ -92,13 +92,13 @@ public void load(ImageView imageView) {
* @return true if there is no other concurrent task running
*/

private boolean checkConcurrentTasks(String url, LoaderTask oldTask) {
private static boolean checkConcurrentTasks(String url, LoaderTask oldTask) {
if (oldTask == null || (!url.equals(oldTask.getUrl()))){
oldTask.cancel(true);
return false;
} else {
// task != null && url == task.getUrl
// there is already a concurrent task fetching the image
return false;
oldTask.cancel(true);
}

return true;
Expand Down

0 comments on commit fee1cc5

Please sign in to comment.