Skip to content

Commit 1f5fb96

Browse files
authored
ChatQuickstart: Fix add participant error message logic
1 parent 54abcff commit 1f5fb96

File tree

1 file changed

+5
-1
lines changed
  • articles/communication-services/quickstarts/chat/includes

1 file changed

+5
-1
lines changed

articles/communication-services/quickstarts/chat/includes/chat-swift.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,11 @@ let user = ChatParticipant(
345345
chatThreadClient.add(participants: [user]) { result, _ in
346346
switch result {
347347
case let .success(result):
348-
(result.invalidParticipants != nil) ? print("Added participant") : print("Error adding participant")
348+
if let errors = result.invalidParticipants, !errors.isEmpty {
349+
print("Error adding participant")
350+
} else {
351+
print("Added participant")
352+
}
349353
case .failure:
350354
print("Failed to add the participant")
351355
}

0 commit comments

Comments
 (0)