Permalink
Browse files

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).
  • Loading branch information...
1 parent 269a648 commit 4a26774818b785770673c2e7e7481fb5ae93affd @andymatuschak andymatuschak committed Jun 16, 2008
Showing with 7 additions and 8 deletions.
  1. +6 −8 SUAppcast.m
  2. +1 −0 Sparkle.xcodeproj/project.pbxproj
View
@@ -35,25 +35,23 @@ - (void)fetchAppcastFromURL:(NSURL *)url
- (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);
}
@@ -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)";
};

0 comments on commit 4a26774

Please sign in to comment.