fix(color): outputs widget may crash when upgrading to 3.0 (#7395)
Co-authored-by: Peter Feerick <5500713+pfeerick@users.noreply.github.com>
This commit is contained in:
@@ -283,16 +283,14 @@ class OutputsWidgetFactory : public WidgetFactory
|
|||||||
const void checkOptions(int screenNum, int zoneNum) const override
|
const void checkOptions(int screenNum, int zoneNum) const override
|
||||||
{
|
{
|
||||||
auto widgetData = g_model.getWidgetData(screenNum, zoneNum);
|
auto widgetData = g_model.getWidgetData(screenNum, zoneNum);
|
||||||
if (widgetData && widgetData->options.size() >= 4) {
|
if (widgetData && widgetData->options.size() >= 2 &&
|
||||||
if (widgetData->options[1].type == WOV_Bool) {
|
widgetData->options.size() < 6 &&
|
||||||
widgetData->options[5] = widgetData->options[4];
|
widgetData->options[1].type == WOV_Bool) {
|
||||||
widgetData->options[4] = widgetData->options[3];
|
WidgetOptionValueTyped v;
|
||||||
widgetData->options[3] = widgetData->options[2];
|
v.type = WOV_Signed;
|
||||||
widgetData->options[2] = widgetData->options[1];
|
v.value.signedValue = MAX_OUTPUT_CHANNELS;
|
||||||
widgetData->options[1].type = WOV_Signed;
|
widgetData->options.insert(widgetData->options.begin() + 1, v);
|
||||||
widgetData->options[1].value.signedValue = MAX_OUTPUT_CHANNELS;
|
storageDirty(EE_MODEL);
|
||||||
storageDirty(EE_MODEL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user