DetectorSettings: Properly handle optional input

This commit is contained in:
2026-04-15 10:43:23 +02:00
parent e01366a75c
commit 2b13bfaa1d
+4 -2
View File
@@ -163,8 +163,10 @@ std::optional<float> DetectorSettings::GetEigerThreshold_keV() const {
}
DetectorSettings &DetectorSettings::EigerThreshold_keV(const std::optional<float> &input) {
check_min("EIGER Threshold (keV)", input, 1.0);
check_max("EIGER Threshold (keV)", input, 100.0);
if (input.has_value()) {
check_min("EIGER Threshold (keV)", input.value(), 1.0);
check_max("EIGER Threshold (keV)", input.value(), 100.0);
}
eiger_threshold_keV = input;
return *this;
}