From a349633adeae21bb63e28eaee5f39c6812c131b3 Mon Sep 17 00:00:00 2001
From: Artur Fedorov <afedorov@gitlab.com>
Date: Wed, 5 Mar 2025 23:39:12 +0100
Subject: [PATCH] Fix Vue 3 specs

Add check for null and undefined
---
 .../javascripts/work_items/components/work_item_assignees.vue | 4 +++-
 scripts/frontend/quarantined_vue3_specs.txt                   | 1 -
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/assets/javascripts/work_items/components/work_item_assignees.vue b/app/assets/javascripts/work_items/components/work_item_assignees.vue
index b392cb003d324..73f882bc94678 100644
--- a/app/assets/javascripts/work_items/components/work_item_assignees.vue
+++ b/app/assets/javascripts/work_items/components/work_item_assignees.vue
@@ -117,7 +117,9 @@ export default {
         if (!data) {
           return;
         }
-        this.localUsers = unionBy(this.localUsers, [data.currentUser], 'id');
+
+        const currentUsers = data.currentUser ? [data.currentUser] : [];
+        this.localUsers = unionBy(this.localUsers, currentUsers, 'id');
       },
     },
   },
diff --git a/scripts/frontend/quarantined_vue3_specs.txt b/scripts/frontend/quarantined_vue3_specs.txt
index 0328b9ca21c74..507636dc041fd 100644
--- a/scripts/frontend/quarantined_vue3_specs.txt
+++ b/scripts/frontend/quarantined_vue3_specs.txt
@@ -246,5 +246,4 @@ spec/frontend/vue_shared/directives/tooltip_on_truncate_spec.js
 spec/frontend/vue_shared/directives/track_event_spec.js
 spec/frontend/vue_shared/issuable/sidebar/components/issuable_sidebar_root_spec.js
 spec/frontend/webhooks/components/push_events_spec.js
-spec/frontend/work_items/components/work_item_assignees_spec.js
 spec/frontend/work_items/components/work_item_description_rendered_spec.js
-- 
GitLab