Skip to content

Commit 198de59

Browse files
committed
fix: handle undefined signers in getAllFiles filter
Add optional chaining to prevent TypeError when value.signers is undefined in file filtering by signer_uuid. This resolves the error 'can't access property "filter", value.signers is undefined' that occurred when navigating to sign PDF page. The issue occurred when files without initialized signers array were being filtered, causing the application to crash on the SignPDF view. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent ff165bb commit 198de59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/store/files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ export const useFilesStore = function(...args) {
282282
Object.entries(this.files).filter(([key, value]) => {
283283
if (filter.signer_uuid) {
284284
// return true when found signer by signer_uuid
285-
return value.signers.filter((signer) => {
285+
return value.signers?.filter((signer) => {
286286
// filter signers by signer_uuid
287287
return signer.sign_uuid === filter.signer_uuid
288288
}).length > 0

0 commit comments

Comments
 (0)