Merge pull request #1282 from vector-im/riot_657

Fix App crashes on [AvatarGenerator imageFromText:withBackgroundColor:]
This commit is contained in:
manuroe 2017-06-12 16:44:32 +02:00 committed by GitHub
commit b2ef890158
2 changed files with 9 additions and 3 deletions

View file

@ -33,9 +33,6 @@ static NSAttributedString *readReceiptVerticalWhitespace = nil;
if (self)
{
// Use the vector style placeholder
self.senderAvatarPlaceholder = [AvatarGenerator generateAvatarForMatrixItem:self.senderId withDisplayName:self.senderDisplayName];
// Increase maximum number of components
self.maxComponentCount = 20;

View file

@ -106,6 +106,15 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
// Do cell data customization that needs to be done before [MXKRoomBubbleTableViewCell render]
RoomBubbleCellData *roomBubbleCellData = [self cellDataAtIndex:indexPath.row];
// Use the Riot style placeholder
if (!roomBubbleCellData.senderAvatarPlaceholder)
{
roomBubbleCellData.senderAvatarPlaceholder = [AvatarGenerator generateAvatarForMatrixItem:roomBubbleCellData.senderId withDisplayName:roomBubbleCellData.senderDisplayName];
}
UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath];
// Finalize cell view customization here