diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index 4885cc025..04434fe18 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -2029,7 +2029,7 @@ static NSArray *childRecordFields = nil; components = [NSMutableArray arrayWithCapacity: max]; for (count = 0; count < max; count++) { - currentName = [cNames objectAtIndex: count]; + currentName = [[cNames objectAtIndex: count] asSafeSQLString]; queryNameLength = idQueryOverhead + [currentName length]; if ((currentSize + queryNameLength) > maxQuerySize) @@ -2043,8 +2043,11 @@ static NSArray *childRecordFields = nil; currentSize += queryNameLength; } - records = [self _fetchComponentsWithNames: currentNames fields: fields]; - [components addObjectsFromArray: records]; + if ([currentNames count]) + { + records = [self _fetchComponentsWithNames: currentNames fields: fields]; + [components addObjectsFromArray: records]; + } // NSLog (@"/fetching components matching names");