From 025ef2c3018959a4044da5feddd19a98bf4291ee Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Mon, 9 Aug 2021 11:20:57 +1000 Subject: [PATCH] clean --- Session/Conversations/ConversationViewModel.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Session/Conversations/ConversationViewModel.m b/Session/Conversations/ConversationViewModel.m index 1e5293b73..efcd2cee8 100644 --- a/Session/Conversations/ConversationViewModel.m +++ b/Session/Conversations/ConversationViewModel.m @@ -835,8 +835,8 @@ NS_ASSUME_NONNULL_BEGIN // to show the date header of the deleted message if needed for (NSString *deletedItemId in deletedItemIdSet) { NSUInteger oldIndex = [oldItemIdList indexOfObject:deletedItemId]; - id _Nullable nextItemId = (oldIndex + 1 < oldItemIdList.count ? oldItemIdList[oldIndex + 1] : nil); - if (nextItemId != nil) { + if (oldIndex != NSNotFound && oldIndex + 1 < oldItemIdList.count) { + NSString *nextItemId = oldItemIdList[oldIndex + 1]; [updatedItemSet addObject:nextItemId]; [updatedNeighborItemSet addObject:nextItemId]; }