Commit 88142b5e authored by ethan's avatar ethan Committed by Kateryna Kostiuk

account model helper's ringId unwrapped unexpected nil exception

Change-Id: I17b1b1094f29824166e268793409dd5d69dc481e
Reviewed-by: Kateryna Kostiuk<kateryna.kostiuk@savoirfairelinux.com>
parent 830eec40
...@@ -109,16 +109,16 @@ class ConversationsService { ...@@ -109,16 +109,16 @@ class ConversationsService {
let contentDict = [self.textPlainMIMEType: content] let contentDict = [self.textPlainMIMEType: content]
let messageId = String(self.messageAdapter.sendMessage(withContent: contentDict, withAccountId: senderAccount.id, to: recipientRingId)) let messageId = String(self.messageAdapter.sendMessage(withContent: contentDict, withAccountId: senderAccount.id, to: recipientRingId))
let accountHelper = AccountModelHelper(withAccount: senderAccount) let accountHelper = AccountModelHelper(withAccount: senderAccount)
if accountHelper.ringId! != recipientRingId { if let ringId = accountHelper.ringId, ringId != recipientRingId {
let message = self.createMessage(withId: messageId, let message = self.createMessage(withId: messageId,
withContent: content, withContent: content,
byAuthor: accountHelper.ringId!, byAuthor: ringId,
generated: false, generated: false,
incoming: false) incoming: false)
self.saveMessage(message: message, self.saveMessage(message: message,
toConversationWith: recipientRingId, toConversationWith: recipientRingId,
toAccountId: senderAccount.id, toAccountId: senderAccount.id,
toAccountUri: accountHelper.ringId!, toAccountUri: ringId,
shouldRefreshConversations: true) shouldRefreshConversations: true)
.subscribe(onCompleted: { [unowned self] in .subscribe(onCompleted: { [unowned self] in
self.log.debug("Message saved") self.log.debug("Message saved")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment