fix(addressbook): Fix NSException on address book where uppercaseString is called on data

This commit is contained in:
smizrahi
2022-11-22 15:12:58 +01:00
parent 96cd1880da
commit c62b043e26
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -62,7 +62,7 @@
{
if (!card)
{
if ([[content uppercaseString] hasPrefix: @"BEGIN:VCARD"])
if ([[[self contentAsString] uppercaseString] hasPrefix: @"BEGIN:VCARD"])
card = [NGVCard parseSingleFromSource: content];
else
card = [NGVCard cardWithUid: [self nameInContainer]];
+3 -1
View File
@@ -97,8 +97,10 @@
int intValue;
data = [objectRecord objectForKey: @"c_content"];
if (data)
if (data && [data isKindOfClass: [NSString class]])
ASSIGN (content, data);
else
ASSIGN (content, [NSString stringWithUTF8String:[data bytes]]);
data = [objectRecord objectForKey: @"c_version"];
if (data)
version = [data unsignedIntValue];