Skip to content

Commit

Permalink
Added check if exists row and section on didEndEditing.
Browse files Browse the repository at this point in the history
  • Loading branch information
bellots committed Jul 23, 2020
1 parent 8fc1882 commit 0a757fc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/Owl/Table/TableDirector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,9 @@ extension TableDirector: UITableViewDataSource, UITableViewDelegate {

public func tableView(_ tableView: UITableView, didEndEditingRowAt indexPath: IndexPath?) {
guard let indexPath = indexPath else { return }
if indexPath.row >= tableView.numberOfRows(inSection: indexPath.section) {
return
}
let (model, adapter) = context(forItemAt: indexPath)
adapter.dispatchEvent(.didEndEdit, model: model, cell: nil, path: indexPath, params: nil)
}
Expand Down

0 comments on commit 0a757fc

Please sign in to comment.