From 22f2435c10ac1f68a424bc089960672f9402aa1e Mon Sep 17 00:00:00 2001
From: Peter Albrecht <albrecpe@gmail.com>
Date: Mon, 20 Nov 2023 16:35:45 +0100
Subject: [PATCH] Fix for segfault on provider click

---
 .../SkillManagerMonitorWidgetController.cpp              | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.cpp b/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.cpp
index 5e90fc77d..608dc84bd 100644
--- a/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.cpp
+++ b/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.cpp
@@ -571,6 +571,7 @@ namespace armarx
     SkillManagerMonitorWidgetController::stopAllExecutions()
     {
         auto tree = widget.treeWidgetSkillExecutions;
+        ARMARX_INFO << "The user requested to stop all skill executions from GUI.";
         for (ssize_t i = 0; i < tree->topLevelItemCount(); ++i)
         {
             auto item = static_cast<SkillExecutionInfoTreeWidgetItem*>(
@@ -585,8 +586,6 @@ namespace armarx
         std::scoped_lock l(updateMutex);
 
         /*
-         * Example skills are not fully specified; disabled check
-         *
         if (selectedSkill.skillExecutionId.skillId.fullySpecified())
         {
             ARMARX_INFO << "The user requested to stop a skill, which was not fully specified!";
@@ -598,7 +597,7 @@ namespace armarx
         {
             return;
         }
-        */
+*/
 
         ARMARX_INFO << "Stopping skill from GUI: " << selectedSkill.skillExecutionId.toString();
 
@@ -639,14 +638,14 @@ namespace armarx
         if (!current->parent())
         {
             // no parent available. Perhaps provider clicked? Reset selected skill.
-            selectedSkill.skillId.providerId->providerName = "";
-            selectedSkill.skillId.skillName = "";
+            selectedSkill.skillId = SelectedSkill::UNK_SKILL_ID;
             return;
         }
 
         auto c = static_cast<SkillInfoTreeWidgetItem*>(current);
         auto skillDescription = c->skillDescription;
 
+
         if (selectedSkill.skillId == skillDescription.skillId)
         {
             // no change
-- 
GitLab