From 73f5d9237d2d2270f308f52e9727cdd02c3f9094 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Mon, 7 Jan 2019 09:56:53 -0500 Subject: [PATCH] Avoid overflow. --- .../ViewControllers/ConversationView/ConversationViewModel.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewModel.m b/Signal/src/ViewControllers/ConversationView/ConversationViewModel.m index cb35f9dcf..c6f42228e 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewModel.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewModel.m @@ -896,7 +896,7 @@ static const int kYapDatabaseRangeMaxLength = 25000; // We skip animations for the last _two_ // interactions, not one since there // may be a typing indicator. - if (updateItem.newIndex < updateItems.count - 2) { + if (updateItem.newIndex + 2 < updateItems.count) { isOnlyModifyingLastMessage = NO; } break;