AllenDang / giu

Cross platform rapid GUI framework for golang based on Dear ImGui.
MIT License
2.11k stars 127 forks source link

[bug] Combo crashes with empty string item #778

Closed aj3423 closed 4 months ago

aj3423 commented 4 months ago

What happend?

Combobox crashes if the items contain empty string like: items = []string{"111", "", "333"}

Code example

main.go ```golang package main import "github.com/AllenDang/giu" var sel int32 func loop() { giu.SingleWindow().Layout( giu.Combo("", "", []string{ "111", "", // <------ crash "333", }, &sel), ) } func main() { wnd := giu.NewMasterWindow("", 400, 200, 0) wnd.Run(loop) } ```

To Reproduce

  1. Run my demo
  2. will see the crash...

Version

(latest)

OS

Fedora 40