replace a bad assert with VALIDATE

assert may only be used for cases that are guaranteed to be true for every possible input.
This commit is contained in:
gfgtdf 2020-09-28 14:20:17 +02:00 committed by GitHub
parent f3b7a17e51
commit 1f81b0fa24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1027,7 +1027,8 @@ namespace select_action
void selection::select(grid& grid, const bool select)
{
selectable_item* selectable = dynamic_cast<selectable_item*>(grid.get_widget(0, 0));
assert(selectable);
//the check in selection::init is not strict enouth to guaranetee this.
VALIDATE(selectable, "Only toggle buttons and panels are allowed as the cells of a list definition.");
selectable->set_value(select);
}