From 72942963f7ac43d00741710518523fcb5eccab54 Mon Sep 17 00:00:00 2001 From: Giom Foret Date: Thu, 28 Dec 2017 16:45:45 +0100 Subject: [PATCH] Bug Fix: App crashes when the user taps on a bubble in which a string component is empty. --- Riot/Model/Room/RoomBubbleCellData.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Riot/Model/Room/RoomBubbleCellData.m b/Riot/Model/Room/RoomBubbleCellData.m index 8771fe0c2..bfea7fc3f 100644 --- a/Riot/Model/Room/RoomBubbleCellData.m +++ b/Riot/Model/Room/RoomBubbleCellData.m @@ -181,7 +181,7 @@ static NSAttributedString *readReceiptVerticalWhitespace = nil; { // Check whether another component than this one is selected // Note: When a component is selected, it is highlighted by applying an alpha on other components. - if (selectedComponentIndex != NSNotFound && selectedComponentIndex != index) + if (selectedComponentIndex != NSNotFound && selectedComponentIndex != index && componentString.length) { // Apply alpha to blur this component NSMutableAttributedString *customComponentString = [[NSMutableAttributedString alloc] initWithAttributedString:componentString]; @@ -226,7 +226,7 @@ static NSAttributedString *readReceiptVerticalWhitespace = nil; [currentAttributedTextMsg appendAttributedString:[MXKRoomBubbleCellDataWithAppendingMode messageSeparator]]; // Check whether another component than this one is selected - if (selectedComponentIndex != NSNotFound && selectedComponentIndex != index) + if (selectedComponentIndex != NSNotFound && selectedComponentIndex != index && componentString.length) { // Apply alpha to blur this component NSMutableAttributedString *customComponentString = [[NSMutableAttributedString alloc] initWithAttributedString:componentString];