Skip to content

Commit

Permalink
Replace unowned modifier with weak for LikesListController parent pro…
Browse files Browse the repository at this point in the history
…perty
  • Loading branch information
justtwago committed May 2, 2024
1 parent 9e3e4cc commit b3d1c8c
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -30,7 +30,7 @@ class LikesListController: NSObject {
private let tableView: UITableView
private var loadingIndicator = UIActivityIndicatorView()
private weak var delegate: LikesListControllerDelegate?
private unowned var parent: UIViewController
private weak var parent: UIViewController?

// Used to control pagination.
private var isFirstLoad = true
Expand Down Expand Up @@ -378,6 +378,9 @@ private extension LikesListController {
let content = snippetBlock.text ?? ""
let action: () -> Void = { [weak self] in self?.delegate?.didSelectHeader!() }

guard let parent = parent else {
return
}
if notification?.kind == .commentLike || notification?.kind == .follow {
let avatar = NoteBlockHeaderTableViewCell.Avatar(
url: mediaURL,
Expand Down

0 comments on commit b3d1c8c

Please sign in to comment.