Fix bug that could cause a crash when an invalid indexPath was used to find a node in the shadow table

This commit is contained in:
Maurice Parker 2019-08-23 13:23:13 -05:00
parent 7f024586bb
commit 1ba60e2846
1 changed files with 1 additions and 1 deletions

View File

@ -344,7 +344,7 @@ class AppCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
}
func nodeFor(_ indexPath: IndexPath) -> Node? {
guard indexPath.section < shadowTable.count || indexPath.row < shadowTable[indexPath.section].count else {
guard indexPath.section < shadowTable.count && indexPath.row < shadowTable[indexPath.section].count else {
return nil
}
return shadowTable[indexPath.section][indexPath.row]