mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-02-15 07:28:59 +00:00
storageRecordOps.toRecipient: Allow for missing recipients
This commit is contained in:
@@ -853,11 +853,14 @@ export function toDefunctOrPendingCallLinkRecord(
|
||||
function toRecipient(
|
||||
conversationId: string,
|
||||
logPrefix: string
|
||||
): Proto.Recipient {
|
||||
): Proto.Recipient | undefined {
|
||||
const conversation = window.ConversationController.get(conversationId);
|
||||
|
||||
if (conversation == null) {
|
||||
throw new Error(`${logPrefix}/toRecipient: Missing conversation`);
|
||||
log.error(
|
||||
`${logPrefix}/toRecipient: Missing conversation with id ${conversationId}`
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const logId = `${logPrefix}/toRecipient(${conversation.idForLogging()})`;
|
||||
@@ -903,9 +906,11 @@ function toRecipients(
|
||||
conversationIds: ReadonlyArray<string>,
|
||||
logPrefix: string
|
||||
): Array<Proto.Recipient> {
|
||||
return conversationIds.map(conversationId => {
|
||||
return toRecipient(conversationId, logPrefix);
|
||||
});
|
||||
return conversationIds
|
||||
.map(conversationId => {
|
||||
return toRecipient(conversationId, logPrefix);
|
||||
})
|
||||
.filter(isNotNil);
|
||||
}
|
||||
|
||||
function toChatFolderRecordFolderType(
|
||||
|
||||
Reference in New Issue
Block a user