probably fix a crash since the sort id might not be initialized

This commit is contained in:
Ryan ZHAO 2020-08-19 14:17:55 +10:00
parent 794ac0c954
commit 8b032a40e4

View file

@ -456,7 +456,7 @@ typedef void (^BuildOutgoingMessageCompletionBlock)(TSOutgoingMessage *savedMess
} else {
TSInteraction *_Nullable firstUnseenInteraction =
[[TSDatabaseView unseenDatabaseViewExtension:transaction] firstObjectInGroup:thread.uniqueId];
if (firstUnseenInteraction) {
if (firstUnseenInteraction && firstUnseenInteraction.sortId != NULL) {
firstUnseenSortId = @(firstUnseenInteraction.sortId);
}
}