From ddf0efde8138059face30fbe02da6ebc0216bc56 Mon Sep 17 00:00:00 2001 From: Pete Walters Date: Tue, 17 Feb 2026 15:46:59 -0600 Subject: [PATCH] Filter out empty emails for contact share message export --- .../BackupArchiveContactAttachmentArchiver.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SignalServiceKit/Backups/Archiving/Archivers/ChatItem/BackupArchiveContactAttachmentArchiver.swift b/SignalServiceKit/Backups/Archiving/Archivers/ChatItem/BackupArchiveContactAttachmentArchiver.swift index e4eca3b610..d0d081c820 100644 --- a/SignalServiceKit/Backups/Archiving/Archivers/ChatItem/BackupArchiveContactAttachmentArchiver.swift +++ b/SignalServiceKit/Backups/Archiving/Archivers/ChatItem/BackupArchiveContactAttachmentArchiver.swift @@ -51,7 +51,7 @@ class BackupArchiveContactAttachmentArchiver: BackupArchiveProtoStreamWriter { for email in contact.emails { switch archiveContactEmail(email).bubbleUp(resultType, partialErrors: &partialErrors) { case .continue(let emailProto): - emailProtos.append(emailProto) + emailProto.map { emailProtos.append($0) } case .bubbleUpError(let errorResult): return errorResult } @@ -148,9 +148,12 @@ class BackupArchiveContactAttachmentArchiver: BackupArchiveProtoStreamWriter { private func archiveContactEmail( _ contactEmail: OWSContactEmail, - ) -> BackupArchive.ArchiveInteractionResult { + ) -> BackupArchive.ArchiveInteractionResult { var emailProto = BackupProto_ContactAttachment.Email() - emailProto.value = contactEmail.email + guard let email = contactEmail.email.nilIfEmpty else { + return .success(nil) + } + emailProto.value = email if let label = contactEmail.label { emailProto.label = label }