From c62b043e26111ee4d6073b9b37931e15f3b95753 Mon Sep 17 00:00:00 2001 From: smizrahi Date: Tue, 22 Nov 2022 15:12:58 +0100 Subject: [PATCH] fix(addressbook): Fix NSException on address book where uppercaseString is called on data --- SoObjects/Contacts/SOGoContactGCSEntry.m | 2 +- SoObjects/SOGo/SOGoContentObject.m | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SoObjects/Contacts/SOGoContactGCSEntry.m b/SoObjects/Contacts/SOGoContactGCSEntry.m index 6f3291a4f..59776c153 100644 --- a/SoObjects/Contacts/SOGoContactGCSEntry.m +++ b/SoObjects/Contacts/SOGoContactGCSEntry.m @@ -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]]; diff --git a/SoObjects/SOGo/SOGoContentObject.m b/SoObjects/SOGo/SOGoContentObject.m index c988f91e1..8adb38299 100644 --- a/SoObjects/SOGo/SOGoContentObject.m +++ b/SoObjects/SOGo/SOGoContentObject.m @@ -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];