-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Checklist
- I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
- This issue only relates to a single bug. I will open new issues for any other problems.
Describe the bug
Table would often randomly pass a negative value to the onSelected function and end up crashing the program. Based on my test, it always passes the correct digit but in negative and it can happen anytime between the first selection and after a couple dozens.
For example,
panic: runtime error: index out of range [-4]
was produced by
actionIdInt, _ := strconv.Atoi((*data)[id.Row][0])
The result of printing id.Row:
4
2
1
-2
Might be related to #2857
How to reproduce
- Create a table
- Set
onSelectedfunction that processes the selected row ID - Click on random cells
- Negative value is passed
Screenshots
No response
Example code
table.OnSelected = func(id widget.TableCellID) {
fmt.Println(id.Row)
fmt.Println(id.Col)
fmt.Println("")
}
Fyne version
v2.4.5
Go compiler version
1.22.3
Operating system and version
Linux Mint 21.3 x86_64
Additional Information
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working