From af7fd60d7688ea972297dd6221026bf73a31895a Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 27 Sep 2017 11:30:33 -0400 Subject: [PATCH] Fix NPE in conversation view. // FREEBIE --- .../ConversationView/ConversationViewController.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index d55c49b72..c64044909 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -1759,7 +1759,11 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) { forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender { - OWSAssert(indexPath); + if (!indexPath) { + // Sometimes this method is called when long-pressing in the body of a text message, + // especially during animations. + return NO; + } id messageData = [self messageAtIndexPath:indexPath]; return [messageData canPerformEditingAction:action];