Merge pull request #1201 from DaveWoodCom/master

Silence some Xcode warnings
This commit is contained in:
Kornel authored and GitHub committed 2018-03-26 12:32:08 +01:00
commit de3e73b589
2 files changed
+14 -10

No files matched your search

+13 -9
View File
@@ -52,16 +52,20 @@ static NSString *SPUDownloadMIMETypeKey = @"SPUDownloadMIMEType";
- (nullable instancetype)initWithCoder:(NSCoder *)decoder
{
NSData *data = [decoder decodeObjectOfClass:[NSData class] forKey:SPUDownloadDataKey];
if (data == nil) {
return nil;
if (@available(macOS 10.8, *)) {
NSData *data = [decoder decodeObjectOfClass:[NSData class] forKey:SPUDownloadDataKey];
if (data == nil) {
return nil;
}
NSString *textEncodingName = [decoder decodeObjectOfClass:[NSString class] forKey:SPUDownloadTextEncodingKey];
NSString *MIMEType = [decoder decodeObjectOfClass:[NSString class] forKey:SPUDownloadMIMETypeKey];
return [self initWithData:data textEncodingName:textEncodingName MIMEType:MIMEType];
} else {
abort(); // Not used on 10.7
}
NSString *textEncodingName = [decoder decodeObjectOfClass:[NSString class] forKey:SPUDownloadTextEncodingKey];
NSString *MIMEType = [decoder decodeObjectOfClass:[NSString class] forKey:SPUDownloadMIMETypeKey];
return [self initWithData:data textEncodingName:textEncodingName MIMEType:MIMEType];
}
@end
+1 -1
View File
@@ -304,7 +304,7 @@
- (void)abortUpdateWithError:(NSError *)error
{
void (^callback)() = ^{
void (^callback)(void) = ^{
if (self.showErrors) {
NSAlert *alert = [[NSAlert alloc] init];
alert.messageText = SULocalizedString(@"Update Error!", nil);