Skip to content

Commit

Permalink
Merge pull request #49 from bellots/master
Browse files Browse the repository at this point in the history
added another control to check if there is the correct element to get context
  • Loading branch information
malcommac authored Aug 4, 2020
2 parents ad2e940 + d18a75d commit e63442a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/Owl/Table/TableDirector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +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) {
if indexPath.row >= tableView.numberOfRows(inSection: indexPath.section) ||
indexPath.section >= sections.count ||
indexPath.row >= sections[indexPath.section].elements.count {
return
}
let (model, adapter) = context(forItemAt: indexPath)
Expand Down

0 comments on commit e63442a

Please sign in to comment.