Add Device Wizard - Avoid crash on user nonsense

Trying to create a custom virtual power curve
with less than 2 points leads to a crash when
saving device config on terminate.
Reported at the users forum.
This commit is contained in:
Alejandro Martinez
2024-12-08 17:57:10 -03:00
parent 2a2eafe926
commit 2505c55f94

View File

@@ -1246,7 +1246,7 @@ void
AddVirtualPower::myCreateCustomPowerCurve() {
bool state = this->blockSignals(true);
if (state) return;
if (state || virtualPowerTableWidget->rowCount() < 2) return;
T_MultiRegressionizer<XYVector<double>> fit(fitEpsilonSpinBox->value(), fitOrderSpinBox->value());