Bug Fix: App crashes when the user taps on a bubble in which a string component is empty.

This commit is contained in:
Giom Foret
2017-12-28 16:45:45 +01:00
parent ded3fa5adb
commit 2bdd2c334d
+2 -2
View File
@@ -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];