diff --git a/JSQMessagesViewController/Controllers/JSQMessagesViewController.m b/JSQMessagesViewController/Controllers/JSQMessagesViewController.m index a995fb056..5ae0856b6 100644 --- a/JSQMessagesViewController/Controllers/JSQMessagesViewController.m +++ b/JSQMessagesViewController/Controllers/JSQMessagesViewController.m @@ -467,8 +467,16 @@ - (UICollectionViewCell *)collectionView:(JSQMessagesCollectionView *)collection if (needsAvatar) { avatarImageDataSource = [collectionView.dataSource collectionView:collectionView avatarImageDataForItemAtIndexPath:indexPath]; if (avatarImageDataSource != nil) { - cell.avatarImageView.image = [avatarImageDataSource avatarImage] ?: [avatarImageDataSource avatarPlaceholderImage]; - cell.avatarImageView.highlightedImage = [avatarImageDataSource avatarHighlightedImage]; + + UIImage *avatarImage = [avatarImageDataSource avatarImage]; + if (avatarImage == nil) { + cell.avatarImageView.image = [avatarImageDataSource avatarPlaceholderImage]; + cell.avatarImageView.highlightedImage = nil; + } + else { + cell.avatarImageView.image = avatarImage; + cell.avatarImageView.highlightedImage = [avatarImageDataSource avatarHighlightedImage]; + } } }