Better nil url handling

This commit is contained in:
Olivier Poitrey 2010-06-12 16:37:47 +02:00
parent 7350e1fa03
commit 65549dec10
1 changed files with 7 additions and 6 deletions

View File

@ -23,14 +23,12 @@
// Remove in progress downloader from queue // Remove in progress downloader from queue
[manager cancelForDelegate:self]; [manager cancelForDelegate:self];
if (!url) UIImage *cachedImage = nil;
if (url)
{ {
self.image = nil; cachedImage = [manager imageWithURL:url];
return;
} }
UIImage *cachedImage = [manager imageWithURL:url];
if (cachedImage) if (cachedImage)
{ {
self.image = cachedImage; self.image = cachedImage;
@ -42,7 +40,10 @@
self.image = placeholder; self.image = placeholder;
} }
[manager downloadWithURL:url delegate:self]; if (url)
{
[manager downloadWithURL:url delegate:self];
}
} }
} }