diff --git a/Sparkle/SPUDownloadData.m b/Sparkle/SPUDownloadData.m index 0d090dbe..e769dd50 100755 --- a/Sparkle/SPUDownloadData.m +++ b/Sparkle/SPUDownloadData.m @@ -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 diff --git a/Sparkle/SUUIBasedUpdateDriver.m b/Sparkle/SUUIBasedUpdateDriver.m index e65b845d..19370652 100644 --- a/Sparkle/SUUIBasedUpdateDriver.m +++ b/Sparkle/SUUIBasedUpdateDriver.m @@ -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);