diff --git a/src/app/formulaire/definition/form-compute-macrorugo-compound.ts b/src/app/formulaire/definition/form-compute-macrorugo-compound.ts index a713e933e64eef65e5e6c13dda27aa6a3617d626..6f2b4c3030bb7060f39c947742ee86307b4aea78 100644 --- a/src/app/formulaire/definition/form-compute-macrorugo-compound.ts +++ b/src/app/formulaire/definition/form-compute-macrorugo-compound.ts @@ -17,6 +17,10 @@ export class FormComputeMacrorugoCompound extends FormCompute { protected compute() { this.runNubCalc(this._formBase.currentNub); + // reset variable index to avoid trying to access an index > 0 when nothing varies + const mrcr = this.formResult.mrcResults; + mrcr.variableIndex = 0; + this.reaffectResultComponents(); } diff --git a/src/app/formulaire/definition/form-compute-pab.ts b/src/app/formulaire/definition/form-compute-pab.ts index 13e0a0ea3ff93267435c49f40b3705d2eece5e93..2f10d0f51f1ef810c884f7ed096f54ae365636b2 100644 --- a/src/app/formulaire/definition/form-compute-pab.ts +++ b/src/app/formulaire/definition/form-compute-pab.ts @@ -17,6 +17,10 @@ export class FormComputePab extends FormCompute { protected compute() { this.runNubCalc(this._formBase.currentNub); + // reset variable index to avoid trying to access an index > 0 when nothing varies + const pabr = this.formResult.pabResults; + pabr.variableIndex = 0; + this.reaffectResultComponents(); }