Skip to content

Commit

Permalink
Be careful with Swift Int conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
lukhnos committed Nov 30, 2023
1 parent 6d57f2a commit 86f3f21
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public class VerticalCandidateController: CandidateController {
let selected = selectedCandidateIndex

scrollTimer?.invalidate()
if visibleRowIndexes.contains(Int(selected)) == false {
if selected == UInt.max || visibleRowIndexes.contains(Int(selected)) == false {
selectedCandidateIndex = UInt(visibleRowIndexes.lowerBound)
tableView.scrollRowToVisible(visibleRowIndexes.lowerBound)
} else {
Expand Down

0 comments on commit 86f3f21

Please sign in to comment.