fix: Check array bounds to avoid crash
This commit is contained in:
+9
-3
@@ -628,9 +628,15 @@ class SeismicNetworksViewController: UIViewController, UITableViewDelegate, UITa
|
||||
if let centerIndexPath = getCenterCellIndexPath(), centerIndexPath != currentCenteredIndexPath {
|
||||
currentCenteredIndexPath = centerIndexPath
|
||||
|
||||
let row = rows[centerIndexPath.row]
|
||||
if case .seismic = row, seismicViewModels.count > centerIndexPath.row {
|
||||
scrollIndicatorView.highlighted = seismicViewModels[centerIndexPath.row]
|
||||
if rows.count > centerIndexPath.row {
|
||||
let row = rows[centerIndexPath.row]
|
||||
if case .seismic = row, seismicViewModels.count > centerIndexPath.row {
|
||||
scrollIndicatorView.highlighted = seismicViewModels[centerIndexPath.row]
|
||||
} else {
|
||||
scrollIndicatorView.highlighted = nil
|
||||
}
|
||||
} else {
|
||||
scrollIndicatorView.highlighted = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user