From 4a26774818b785770673c2e7e7481fb5ae93affd Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Sun, 15 Jun 2008 22:23:31 -0700 Subject: [PATCH] Fixes 240274 Sparkle no longer crashes when the appcast contains an enclosure with no URL (or if there's any other exception in appcast parsing). --- SUAppcast.m | 14 ++++++-------- Sparkle.xcodeproj/project.pbxproj | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/SUAppcast.m b/SUAppcast.m index fdd14df4..990b3df7 100644 --- a/SUAppcast.m +++ b/SUAppcast.m @@ -35,25 +35,23 @@ - (void)feedDidFinishLoading:(RSS *)feed { // Set up all the appcast items: - items = [NSMutableArray array]; + NSArray *tempItems = [NSMutableArray array]; id enumerator = [[feed newsItems] objectEnumerator], current; @try { while ((current = [enumerator nextObject])) { - [(NSMutableArray *)items addObject:[[[SUAppcastItem alloc] initWithDictionary:current] autorelease]]; + [(NSMutableArray *)tempItems addObject:[[[SUAppcastItem alloc] initWithDictionary:current] autorelease]]; } + items = [[NSArray arrayWithArray:tempItems] retain]; // Make the items list immutable. + + if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:)]) + [delegate performSelectorOnMainThread:@selector(appcastDidFinishLoading:) withObject:self waitUntilDone:NO]; } @catch (NSException *parseException) { [self reportError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastParseError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while parsing the update feed.", nil), NSLocalizedDescriptionKey, [parseException reason], SUTechnicalErrorInformationKey, nil]]]; - return; } - items = [[NSArray arrayWithArray:items] retain]; // Make the items list immutable. - - if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:)]) - [delegate performSelectorOnMainThread:@selector(appcastDidFinishLoading:) withObject:self waitUntilDone:NO]; - CFRelease(feed); } diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 2c9d6572..22c13285 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -1001,6 +1001,7 @@ 61072EAD0DF263BD008FE88B /* Release (GC dual-mode; 10.5-only) */ = { isa = XCBuildConfiguration; buildSettings = { + GCC_VERSION = ""; }; name = "Release (GC dual-mode; 10.5-only)"; };