Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in Switches.OnChange: SelectedItem() or .Value can be nil in a Mutex mode, but it should never be. #1291

Open
rcoreilly opened this issue Nov 7, 2024 · 1 comment
Labels
bug Something isn't working correctly needs test Needs a reproducible test case
Milestone

Comments

@rcoreilly
Copy link
Member

Describe the bug

emergent/egui/loopctrl.go:72 is the crash:

		tree.AddAt(p, pfx+"loop-mode", func(w *core.Switches) {
			w.SetType(core.SwitchSegmentedButton)
			w.Mutex = true
			w.SetEnums(modes...)
			w.SelectValue(curMode)
			w.FinalStyler(func(s *styles.Style) {
				s.Grow.Set(0, 0)
			})
			w.OnChange(func(e events.Event) {
-> line 72:		curMode = w.SelectedItem().Value.(enums.Enum)
				st := loops.Stacks[curMode]
				if st != nil {
					curStep = st.StepLevel
				}
				updateSteps()
				stepChoose.Update()
				stepN := st.Loops[curStep].StepCount
				stepNSpin.SetValue(float32(stepN))
				stepNSpin.Update()
			})
		})

How to reproduce

run ccn sims on web, probably in a slow system? I didn't get this on my mac.

Example code

No response

Relevant output

No response

Platform

macOS

@rcoreilly rcoreilly added the bug Something isn't working correctly label Nov 7, 2024
@kkoreilly kkoreilly added the needs test Needs a reproducible test case label Nov 11, 2024
@kkoreilly kkoreilly added this to the v0.4 milestone Nov 11, 2024
@kkoreilly
Copy link
Member

Need a reproducible test case before I can fix this.

@kkoreilly kkoreilly added this to Bugs Nov 18, 2024
@github-project-automation github-project-automation bot moved this to Todo in Bugs Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly needs test Needs a reproducible test case
Projects
Status: Todo
Development

No branches or pull requests

2 participants