Fix possible exception setting header value

This commit is contained in:
Richard Frith-Macdonald 2023-02-09 11:03:21 +00:00
parent b8aedfc53e
commit 3631c4b068
2 changed files with 11 additions and 2 deletions

View file

@ -4688,8 +4688,11 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
NSArray *a;
a = [[value lowercaseString] componentsSeparatedByString: @"/"];
[self setObject: [a objectAtIndex: 0] forKey: @"Type"];
[self setObject: [a objectAtIndex: 1] forKey: @"Subtype"];
if ([a count] == 2)
{
[self setObject: [a objectAtIndex: 0] forKey: @"Type"];
[self setObject: [a objectAtIndex: 1] forKey: @"Subtype"];
}
}
}