From bb7b9f179603acbaa13609a49ab7f45343730c13 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr>
Date: Wed, 15 Jun 2022 17:26:09 +0200
Subject: [PATCH] refactor: FieldsetContainerComponent.addSubNub(): move
 parameters backup

refs #510
---
 .../fieldset-container/fieldset-container.component.ts          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/app/components/fieldset-container/fieldset-container.component.ts b/src/app/components/fieldset-container/fieldset-container.component.ts
index c98450cdc..3f4727b53 100644
--- a/src/app/components/fieldset-container/fieldset-container.component.ts
+++ b/src/app/components/fieldset-container/fieldset-container.component.ts
@@ -83,9 +83,9 @@ export class FieldsetContainerComponent implements DoCheck, AfterViewInit {
      * dans un nouveau fieldset
      */
     private addSubNub(after: FieldSet, clone: boolean = false) {
-        const prms = clone ? after.backupParameters() : undefined;
         const newFs = this._container.addFromTemplate(0, after.indexAsKid());
         if (clone) {
+            const prms = after.backupParameters();
             // replace in-place to change properties (overkill)
             // @WTF why only those two ?
             newFs.setPropValue("structureType", after.properties.getPropValue("structureType"));
-- 
GitLab