mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Fix error handling the case where a cookie is not parseable ... in needs to be removed from the array.
This commit is contained in:
parent
34112fa510
commit
e7716e6ed1
1 changed files with 9 additions and 9 deletions
|
@ -161,7 +161,7 @@ static NSMutableArray *GSCookieStrings(NSString *string);
|
|||
dates and also could have tokens without values. */
|
||||
while (count-- > 0)
|
||||
{
|
||||
NSHTTPCookie *cookie;
|
||||
NSHTTPCookie *cookie = nil;
|
||||
NSMutableDictionary *dict;
|
||||
NSString *onecookie = [cookies objectAtIndex: count];
|
||||
|
||||
|
@ -181,14 +181,14 @@ static NSMutableArray *GSCookieStrings(NSString *string);
|
|||
[dict setObject: defaultDomain forKey: NSHTTPCookieDomain];
|
||||
}
|
||||
cookie = [NSHTTPCookie cookieWithProperties: dict];
|
||||
if (cookie)
|
||||
{
|
||||
[cookies replaceObjectAtIndex: count withObject: cookie];
|
||||
}
|
||||
else
|
||||
{
|
||||
[cookies removeObjectAtIndex: count];
|
||||
}
|
||||
}
|
||||
if (cookie)
|
||||
{
|
||||
[cookies replaceObjectAtIndex: count withObject: cookie];
|
||||
}
|
||||
else
|
||||
{
|
||||
[cookies removeObjectAtIndex: count];
|
||||
}
|
||||
}
|
||||
return cookies;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue