From b35928a06202e57daed6abc84eef41bf7d71cb4f Mon Sep 17 00:00:00 2001
From: VIAUD Nathan <nathan.viaud@inria.fr>
Date: Mon, 25 Mar 2024 14:41:13 +0100
Subject: [PATCH] fix(dev): map on plugins even when empty

---
 src/shared/services/graph.service.ts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/shared/services/graph.service.ts b/src/shared/services/graph.service.ts
index d696238b..295feb20 100644
--- a/src/shared/services/graph.service.ts
+++ b/src/shared/services/graph.service.ts
@@ -73,6 +73,7 @@ function createContentJSON(): EpocV1 {
     const validBadges = getValidBadges();
 
     const ePocValues = ePocNode.data.formValues;
+    const plugins = ePocValues.plugins ? ePocValues.plugins.map((plugin: any) => plugin.script) : [];
 
     const epoc = new EpocV1(
         ePocValues.id || 'E000XX',
@@ -87,7 +88,7 @@ function createContentJSON(): EpocV1 {
         ePocValues.certificateScore || 10,
         ePocValues.certificateBadgeCount || 1,
         ePocValues.authors || {},
-        ePocValues.plugins.map((plugin: any) => plugin.script),
+        plugins,
         ePocValues.chapterParameter,
         new Date().toISOString(),
         {
-- 
GitLab