mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 10:32:26 +00:00
Added status code check to prevent empty icons
This commit is contained in:
@@ -137,7 +137,9 @@ typedef NS_ENUM(NSInteger, MPIconDownloadStatus) {
|
|||||||
//[NSApp presentError:error];
|
//[NSApp presentError:error];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(data.length > 0) {
|
if([response respondsToSelector:@selector(statusCode)] &&
|
||||||
|
(200 == [(id)response statusCode])
|
||||||
|
&& data.length > 0) {
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
KPKIcon *newIcon = [[KPKIcon alloc] initWithImageData:data];
|
KPKIcon *newIcon = [[KPKIcon alloc] initWithImageData:data];
|
||||||
if(newIcon) {
|
if(newIcon) {
|
||||||
|
|||||||
Reference in New Issue
Block a user