calib: defensive guards in find_optimal_PA_speed (fix CLI pa-tower SIGSEGV) (#14414)

This commit is contained in:
packerlschupfer
2026-09-18 14:26:14 -03:00
committed by GitHub
parent 8a17df4a89
commit f9e9cff53a
2 changed files with 17 additions and 4 deletions
+3 -1
View File
@@ -776,7 +776,9 @@ double ConfigBase::get_abs_value(const t_config_option_key &opt_key, double rati
{
// Get stored option value.
const ConfigOption *raw_opt = this->option(opt_key);
assert(raw_opt != nullptr);
// Mirror the single-arg overload — assert() is a no-op under NDEBUG.
if (raw_opt == nullptr)
throw ConfigurationError("ConfigBase::get_abs_value(): \"" + opt_key + "\" is not defined");
if (raw_opt->type() != coFloatOrPercent)
throw ConfigurationError("ConfigBase::get_abs_value(): opt_key is not of coFloatOrPercent");
// Compute absolute value.