From c3f54b212b9c7e414f48c9d52936795fea9f88ce Mon Sep 17 00:00:00 2001 From: "mathias.chouet" <mathias.chouet@irstea.fr> Date: Tue, 19 Feb 2019 16:38:06 +0100 Subject: [PATCH] =?UTF-8?q?Chargement=20d'une=20session=20avec=20param?= =?UTF-8?q?=C3=A8tre=20li=C3=A9:=20protection=20contre=20formulaire=20cibl?= =?UTF-8?q?e=20inexistant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/formulaire/ngparam.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/formulaire/ngparam.ts b/src/app/formulaire/ngparam.ts index 8bf3c34f7..1c82a275a 100644 --- a/src/app/formulaire/ngparam.ts +++ b/src/app/formulaire/ngparam.ts @@ -381,8 +381,14 @@ export class NgParameter extends InputField implements Observer { this._paramValues.valueMode = ParamValueMode.LINK; // formulaire dont le Nub est la cible du lien const destForm = ServiceFactory.instance.formulaireService.getFormulaireFromId(uid); - this._paramValues.defineReference(destForm.currentNub, ref); - break; // cf FormulaireService.updateParamsLinks() + if (destForm) { + this._paramValues.defineReference(destForm.currentNub, ref); + } else { + // @TODO et si la cible du lien n'existe pas ?? + // cf FormulaireService.updateParamsLinks() + console.log("LA CIBLE DU LIEN N'EXISTE PAS !!"); + } + break; default: throw new Error(`session file : invalid value mode '${json["mode"]}' in param object`); -- GitLab