Created
September 6, 2021 05:12
-
-
Save TkTech/83bd5cb855073d67e772e8412b3f28a2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/smsapp/conversationmodel.cpp b/smsapp/conversationmodel.cpp | |
index 7cd80abc..755f3796 100644 | |
--- a/smsapp/conversationmodel.cpp | |
+++ b/smsapp/conversationmodel.cpp | |
@@ -142,8 +142,11 @@ void ConversationModel::createRowFromMessage(const ConversationMessage& message, | |
return; | |
} | |
- ConversationAddress sender = message.addresses().first(); | |
- QString senderName = message.isIncoming() ? SmsHelper::getTitleForAddresses({sender}) : QString(); | |
+ QList<ConversationAddress> addresses = message.addresses(); | |
+ QString senderName = QString(); | |
+ if (message.isIncoming() && !addresses.isEmpty()) { | |
+ senderName = SmsHelper::getTitleForAddresses({addresses.first()}); | |
+ } | |
QString displayBody = message.body(); | |
auto item = new QStandardItem; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment