Better nil url handling
This commit is contained in:
parent
7350e1fa03
commit
65549dec10
|
@ -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];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue