Fix App crashes on [AvatarGenerator imageFromText:withBackgroundColor:]

https://github.com/vector-im/riot-ios/issues/657

Do not call [AvatarGenerator imageFromText:withBackgroundColor:] outside main thread.
This commit is contained in:
manuroe
2017-06-12 15:06:35 +02:00
parent 3c66e60d32
commit 865dc0da38
2 changed files with 9 additions and 3 deletions
+9
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