From 12a0547736fa67833579da9e4d6052724ee89ba9 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Tue, 15 Aug 2023 07:58:07 +0200
Subject: [PATCH] Scale::clipped check input

---
 Base/Axis/Scale.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Base/Axis/Scale.cpp b/Base/Axis/Scale.cpp
index a02f21b1b6d..d9d2c33ff45 100644
--- a/Base/Axis/Scale.cpp
+++ b/Base/Axis/Scale.cpp
@@ -149,6 +149,8 @@ bool Scale::isScan() const
 
 Scale Scale::clipped(double lower, double upper) const
 {
+    if (lower > upper)
+        throw std::runtime_error("Scale::clipped called with invalid bounds (lower > upper)");
     std::vector<Bin1D> out_bins;
     const bool is_scan = isScan();
     for (const Bin1D& b : m_bins)
-- 
GitLab