From 153c1eeb80b7b52d65635346d54a79f13109f48c Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 9 Dec 2021 10:03:59 -0500 Subject: [PATCH] fix(core): avoid exception when the user's cn is null --- SoObjects/SOGo/SOGoUser.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index fe7751fcd..7edbce1f7 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -284,7 +284,11 @@ - (void) _fetchCN { - cn = [[self _fetchFieldForUser: @"cn"] stringByTrimmingSpaces]; + cn = [self _fetchFieldForUser: @"cn"]; + if ([cn isNotNull]) + cn = [cn stringByTrimmingSpaces]; + else + cn = [NSString stringWithString: login]; [cn retain]; }