Skip to content

Commit

Permalink
fix: Crash when viewing conversation details with no admins - WPB-145…
Browse files Browse the repository at this point in the history
…72 (#2229)
  • Loading branch information
samwyndham authored Nov 29, 2024
1 parent eaf59ce commit 7fcbdc3
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ final class ParticipantsSectionController: GroupDetailsSectionController {
private var viewModel: ParticipantsSectionViewModel
private let conversation: GroupDetailsConversationType
private var token: NSObjectProtocol?
private lazy var sizingFooter = SectionFooter()

init(
participants: [UserType],
Expand Down Expand Up @@ -299,17 +300,12 @@ final class ParticipantsSectionController: GroupDetailsSectionController {
referenceSizeForFooterInSection section: Int
) -> CGSize {

guard
viewModel.footerVisible,
let footer = collectionView.dequeueFooter(for: IndexPath(item: 0, section: section)) as? SectionFooter
else {
return .zero
}
guard viewModel.footerVisible else { return .zero }

footer.titleLabel.text = viewModel.footerTitle
footer.size(fittingWidth: collectionView.bounds.width)
sizingFooter.titleLabel.text = viewModel.footerTitle
sizingFooter.size(fittingWidth: collectionView.bounds.width)

return footer.bounds.size
return sizingFooter.bounds.size
}

override func collectionView(
Expand Down

0 comments on commit 7fcbdc3

Please sign in to comment.