Correctly check for nested arrays in `Widget::isValidOption()` (see #5328)