Fix crash loading aida-x in module browser

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2023-07-12 11:50:50 +02:00
parent 4290091df7
commit d3c5283e8b

View file

@ -843,10 +843,11 @@ struct AidaSwitch : app::Switch {
{
engine::ParamQuantity* pq = getParamQuantity();
bool checked;
if (pq == nullptr)
return;
const bool checked = inverted ? pq->getValue() <= pq->getMinValue() : pq->getValue() > pq->getMinValue();
checked = inverted ? pq->getValue() <= pq->getMinValue() : pq->getValue() > pq->getMinValue();
else
checked = true;
nvgBeginPath(args.vg);
nvgRoundedRect(args.vg, 0, 0, box.size.x, box.size.y, kSwitchWidth/2);