diff --git a/UIImageView+WebCache.m b/UIImageView+WebCache.m index 45fc65b7..24c7c493 100644 --- a/UIImageView+WebCache.m +++ b/UIImageView+WebCache.m @@ -23,14 +23,12 @@ // Remove in progress downloader from queue [manager cancelForDelegate:self]; - if (!url) + UIImage *cachedImage = nil; + if (url) { - self.image = nil; - return; + cachedImage = [manager imageWithURL:url]; } - UIImage *cachedImage = [manager imageWithURL:url]; - if (cachedImage) { self.image = cachedImage; @@ -42,7 +40,10 @@ self.image = placeholder; } - [manager downloadWithURL:url delegate:self]; + if (url) + { + [manager downloadWithURL:url delegate:self]; + } } }