Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes 256106

      
Sparkle will no longer break on nil XML nodes; that would occur when a node is commented out. Thanks to Christiaan Hofman for the patch.
  • Loading branch information...
commit 0343569cdc927ce7257a412ae323dab9031692af 1 parent 32a804e
@andymatuschak andymatuschak authored
Showing with 10 additions and 8 deletions.
  1. +10 −8 SUAppcast.m
View
18 SUAppcast.m
@@ -83,14 +83,16 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection
while (nil != node)
{
NSString *name = [node name];
- NSMutableArray *nodes = [nodesDict objectForKey:name];
- if (nodes == nil)
+ if (name)
{
- nodes = [NSMutableArray array];
- [nodesDict setObject:nodes forKey:name];
+ NSMutableArray *nodes = [nodesDict objectForKey:name];
+ if (nodes == nil)
+ {
+ nodes = [NSMutableArray array];
+ [nodesDict setObject:nodes forKey:name];
+ }
+ [nodes addObject:node];
}
- [nodes addObject:node];
-
node = [node nextSibling];
}
}
@@ -196,10 +198,10 @@ - (NSXMLNode *)bestNodeInNodes:(NSArray *)nodes
while ((node = [nodeEnum nextObject]))
{
lang = [[node attributeForName:@"xml:lang"] stringValue];
- [languages addObject:(lang ?: @"")]; // Default to a key being English if no xml:lang is specified.
+ [languages addObject:(lang ?: @"")];
}
lang = [[NSBundle preferredLocalizationsFromArray:languages] objectAtIndex:0];
- i = [languages indexOfObject:(lang ?: @"")];
+ i = [languages indexOfObject:([languages containsObject:lang] ? lang : @"")];
if (i == NSNotFound)
i = 0;
return [nodes objectAtIndex:i];
Please sign in to comment.
Something went wrong with that request. Please try again.