Skip to content

Commit a511caa

Browse files
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 418774a commit a511caa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/store/files.js

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

0 commit comments

Comments
 (0)