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

Empty main menu causes panic #1073

Closed
Atomotron opened this issue Jun 2, 2020 · 1 comment
Closed

Empty main menu causes panic #1073

Atomotron opened this issue Jun 2, 2020 · 1 comment
Labels
blocker Items that would block a forthcoming release bug Something isn't working
Milestone

Comments

@Atomotron
Copy link

Atomotron commented Jun 2, 2020

Setting the window's main menu to an empty main menu will cause a panic on glfw.
This line will cause a panic:
w.SetMainMenu(fyne.NewMainMenu())
The panic is:
panic: runtime error: index out of range [0] with length 0

This happens with the glfw driver on the develop branch.

The panic is caused by a line in this file. The line begins with,

if menus.Items[0].Items[len(menus.Items[0].Items)-1].Label

This assumes that menus.Items has an entry at index zero.

@andydotxyz andydotxyz added the bug Something isn't working label Jun 3, 2020
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Jun 3, 2020
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Jun 3, 2020
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Jun 3, 2020
@andydotxyz andydotxyz added the blocker Items that would block a forthcoming release label Jun 10, 2020
@andydotxyz
Copy link
Member

The fix is on develop branch for testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Items that would block a forthcoming release bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants