From cdcc3de45de9948cb82f6978ba826dbdc940a9dd Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Sun, 21 May 2023 20:03:51 +0200
Subject: [PATCH] ComboProperty: throw -> ASSERT

---
 GUI/Model/Data/ComboProperty.cpp | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/GUI/Model/Data/ComboProperty.cpp b/GUI/Model/Data/ComboProperty.cpp
index cd736e42588..67bc2f24000 100644
--- a/GUI/Model/Data/ComboProperty.cpp
+++ b/GUI/Model/Data/ComboProperty.cpp
@@ -14,8 +14,8 @@
 
 #include "GUI/Model/Data/ComboProperty.h"
 #include "Base/Util/Assert.h"
-#include "GUI/Support/Util/Error.h"
 #include "GUI/Support/XML/UtilXML.h"
+
 namespace {
 
 const QString value_separator = ";";
@@ -23,6 +23,7 @@ const QString selection_separator = ",";
 
 } // namespace
 
+
 ComboProperty::ComboProperty() = default;
 
 ComboProperty::ComboProperty(QStringList values)
@@ -60,10 +61,7 @@ QString ComboProperty::currentValue() const
 
 void ComboProperty::setCurrentValue(const QString& name)
 {
-    if (!m_values.contains(name))
-        throw Error("ComboProperty::setValue -> Error. Combo doesn't contain "
-                    "value "
-                    + name);
+    ASSERT(m_values.contains(name));
     setCurrentIndex(m_values.indexOf(name));
 }
 
@@ -100,9 +98,7 @@ int ComboProperty::currentIndex() const
 
 void ComboProperty::setCurrentIndex(int index)
 {
-    if (index < 0 || index >= m_values.size())
-        throw Error("ComboProperty::setCurrentIndex(int index) -> Error. "
-                    "Invalid index");
+    ASSERT(index >= 0 && index < m_values.size());
     m_selected_indices.clear();
     m_selected_indices.push_back(index);
 }
-- 
GitLab