From 2b13bfaa1d8f9b3f5aa8e463a2a03e846c78d84e Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Wed, 15 Apr 2026 10:43:23 +0200 Subject: [PATCH] DetectorSettings: Properly handle optional input --- common/DetectorSettings.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/DetectorSettings.cpp b/common/DetectorSettings.cpp index a0a7e536..24aae992 100644 --- a/common/DetectorSettings.cpp +++ b/common/DetectorSettings.cpp @@ -163,8 +163,10 @@ std::optional DetectorSettings::GetEigerThreshold_keV() const { } DetectorSettings &DetectorSettings::EigerThreshold_keV(const std::optional &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; }