From 08bc35ae158fee60b0f4b0ac9f64b62bd2432adc Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Mon, 13 Jan 2025 09:55:42 -0300 Subject: [PATCH] fix: prevent error when add new signer At listing of sign request immediately after then is uploaded a file to request a new signature, the frontend iterate at signers array but signers wasn't initialized at this moment. Was added a check preventing access to undefined property Signed-off-by: Vitor Mattos --- src/store/files.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/store/files.js b/src/store/files.js index a319835530..0d67c9e1d8 100644 --- a/src/store/files.js +++ b/src/store/files.js @@ -199,6 +199,9 @@ export const useFilesStore = function(...args) { }, signerUpdate(signer) { this.addIdentifierToSigner(signer) + if (!this.getFile().signers?.length) { + this.getFile().signers = [] + } // Remove if already exists for (let i = this.getFile().signers.length - 1; i >= 0; i--) { if (this.getFile().signers[i].identify === signer.identify) {