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
[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,9 +40,12 @@
self.image = placeholder;
}
if (url)
{
[manager downloadWithURL:url delegate:self];
}
}
}
- (void)cancelCurrentImageLoad
{