diff --git a/ts/models/messages.ts b/ts/models/messages.ts index f2ffe5567b2..1b1c4867af1 100644 --- a/ts/models/messages.ts +++ b/ts/models/messages.ts @@ -226,15 +226,19 @@ export class MessageModel extends window.Backbone.Model { ); } - const sendStateByConversationId = migrateLegacySendAttributes( - this.attributes, - window.ConversationController.get.bind(window.ConversationController), - window.ConversationController.getOurConversationIdOrThrow() - ); - if (sendStateByConversationId) { - this.set('sendStateByConversationId', sendStateByConversationId, { - silent: true, - }); + const ourConversationId = + window.ConversationController.getOurConversationId(); + if (ourConversationId) { + const sendStateByConversationId = migrateLegacySendAttributes( + this.attributes, + window.ConversationController.get.bind(window.ConversationController), + ourConversationId + ); + if (sendStateByConversationId) { + this.set('sendStateByConversationId', sendStateByConversationId, { + silent: true, + }); + } } this.CURRENT_PROTOCOL_VERSION = Proto.DataMessage.ProtocolVersion.CURRENT;