From 7b5cddcf2dd613e3e56668837af97f1d731e9e06 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 7 Sep 2021 13:35:48 -0400 Subject: [PATCH] fix(addressbook): generate UID when importing cards if missing Fixes #5386 --- UI/Contacts/UIxContactFolderActions.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UI/Contacts/UIxContactFolderActions.m b/UI/Contacts/UIxContactFolderActions.m index 0a3f7c7fc..aabcb89a9 100644 --- a/UI/Contacts/UIxContactFolderActions.m +++ b/UI/Contacts/UIxContactFolderActions.m @@ -370,6 +370,11 @@ static NSArray *photoTags = nil; // TODO: shall we add .vcf as in [SOGoContactGCSEntry copyToFolder:] uid = [card uid]; + if (![uid length]) + { + uid = [folder globallyUniqueObjectId]; + [card setUid: uid]; + } contact = [SOGoContactGCSEntry objectWithName: uid inContainer: folder]; [contact setIsNew: YES];