FIX: [STUDIO-1694] change support filament to default if out of range

Change-Id: Ie67b1832ec92cd66c14461d01363bbf2c2069185
This commit is contained in:
chunmao.guo 2022-12-09 10:34:43 +08:00 committed by Lane.Wei
parent 88fbcb181e
commit 31ff48ccca
3 changed files with 11 additions and 2 deletions

View file

@ -447,7 +447,7 @@ static struct DynamicFilamentList : DynamicList
int index_of(wxString value) override
{
long n = 0;
return value.ToLong(&n) ? int(n) : -1;
return (value.ToLong(&n) && n <= items.size()) ? int(n) : -1;
}
void update(bool force = false)
{