Fix #281 std::bad_optional_access in RawMasterFile::roi() (#282)
Build on RHEL8 / build (push) Successful in 2m22s
Build on RHEL9 / build (push) Successful in 2m34s
Run tests using data on local RHEL8 / build (push) Successful in 3m7s
Build on local RHEL8 / build (push) Successful in 2m7s

Fixes #281
This commit is contained in:
2026-02-27 12:17:17 +01:00
committed by GitHub
parent bfbb4eab05
commit c665c0e6c6
+9
View File
@@ -194,6 +194,15 @@ ScanParameters RawMasterFile::scan_parameters() const {
}
std::optional<ROI> RawMasterFile::roi() const {
if (!m_rois) {
return std::nullopt;
}
if (m_rois->empty()) {
throw std::runtime_error(LOCATION +
"Zero ROIs in metadata.");
}
if (m_rois.value().size() > 1) {
throw std::runtime_error(LOCATION +
"Multiple ROIs present, use rois() method.");