diff --git a/GUI/Models/SelectionDescriptor.h b/GUI/Models/SelectionDescriptor.h
index bf1fdeb95a40a6fd227940157c8565c28bc7e28e..ef4183e0316afdbcaf1778b867d9ad6a7389cd5e 100644
--- a/GUI/Models/SelectionDescriptor.h
+++ b/GUI/Models/SelectionDescriptor.h
@@ -40,14 +40,25 @@ using std::function;
 //! member, a std::variant or any other construction to define a selection.
 template <typename T> class SelectionDescriptor {
 public:
-    SelectionDescriptor() = default;
+    SelectionDescriptor()
+    {
+        // initialize function pointers to a lambda which throws an error. This helps later on if
+        // accidentally the real initialization has been forgotten.
+        setCurrentIndex = [](int) { throw std::runtime_error("Function pointer not initialized"); };
+
+        currentIndex = []() -> int {
+            throw std::runtime_error("Function pointer not initialized");
+        };
+
+        currentItem = []() -> T { throw std::runtime_error("Function pointer not initialized"); };
+    }
 
     //! Initialize the members by means of a GroupItem.
     //!
     //! currentItem can only be initialized if the template parameter is a pointer (like
     //! RotationItem*). If it is e.g. a std::variant<>, the currentItem has to be initialized by the
     //! caller. Only for easier migration. Should be removed after SessionItem refactoring.
-    explicit SelectionDescriptor(GroupItem* item)
+    explicit SelectionDescriptor(GroupItem* item) : SelectionDescriptor()
     {
         label = item->displayName();
         options = item->value().value<ComboProperty>().getValues();
@@ -65,12 +76,12 @@ public:
             currentItem = [=] { return dynamic_cast<T>(item->currentItem()); };
     }
 
-    QString label;       //!< A label text (short, no trailing colon)
-    QString tooltip;     //!< Tooltip text
-    QStringList options; //!< List of options, usually presented as combo entries
-    function<void(int)> setCurrentIndex = nullptr; //!< Function to set currently selected option
-    function<int()> currentIndex = nullptr;        //!< Function to get currently selected option
-    function<T()> currentItem = nullptr;           //!< Function to get currently selected item
+    QString label;                       //!< A label text (short, no trailing colon)
+    QString tooltip;                     //!< Tooltip text
+    QStringList options;                 //!< List of options, usually presented as combo entries
+    function<void(int)> setCurrentIndex; //!< Function to set currently selected option
+    function<int()> currentIndex;        //!< Function to get currently selected option
+    function<T()> currentItem;           //!< Function to get currently selected item
 };
 
 #endif // BORNAGAIN_GUI_MODELS_SELECTIONDESCRIPTOR_H