From 10fbceb2addf2c43d35cf4250ad37e3266b8b9e6 Mon Sep 17 00:00:00 2001
From: mlbonhomme <bonhomme@teklia.com>
Date: Mon, 11 Sep 2023 17:57:58 +0200
Subject: [PATCH] Do not compute configuration name from worker configurations
 store when removing a configuration

---
 src/components/Process/Workers/Configurations/List.vue | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/components/Process/Workers/Configurations/List.vue b/src/components/Process/Workers/Configurations/List.vue
index a5733cef8..96055fe20 100644
--- a/src/components/Process/Workers/Configurations/List.vue
+++ b/src/components/Process/Workers/Configurations/List.vue
@@ -342,8 +342,10 @@ export default {
        * potential race condition as updateWorkerRun causes workerId to be re-computed when a
        * configuration is first saved for a newly added worker run, which triggers
        * retrieveConfigurations again through a watcher.
+       * When removing a configuration, selectedConfigurationId is null.
        */
-      const configurationName = this.workerConfigurations[this.workerId][this.selectedConfigurationId].name
+      let configurationName = ''
+      if (this.selectedConfigurationId) configurationName = this.workerConfigurations[this.workerId][this.selectedConfigurationId].name
       try {
         await this.updateWorkerRun({
           processId: this.processId,
-- 
GitLab