PopUpMenu.item throws errors if item list is empty #6503
Labels
bug
Issues that relate to unexpected/unwanted behavior. Don't use for PRs.
comp: class library
SC class library
comp: Qt GUI
sclang Qt components -- for IDE tickets, use "env: SCIDE" instead
Attempting to access an item from
PopUpMenu
will fail with an error if the item list is either non-instantiated or empty. The error message is the same as attempting to access an element of an non-instantiated or empty collection, which makes debugging difficult and time-consuming. This can come up when the menu item list is automatically populated and there is a chance it could be empty (in my case, selecting a hardware peripheral).Environment
Steps to reproduce
Expected vs. actual behavior
Expected: return nil with no error or fail with a more informative error
Actual: misleading error
The text was updated successfully, but these errors were encountered: