fix: guard against undefined fields when loading old localStorage data

Old entries in localStorage lack new fields (department, role, contactPersons,
linkedEntryIds, attachments, versions, placeholders, ipAddress, vendor, model).
Add null-coalescing guards to prevent client-side crashes on property access.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Marius Tarau
2026-02-18 06:49:08 +02:00
parent 2c9f0bc6b7
commit f0b878cf00
9 changed files with 22 additions and 21 deletions

View File

@@ -76,8 +76,8 @@ export function useContacts() {
c.company.toLowerCase().includes(q) ||
c.email.toLowerCase().includes(q) ||
c.phone.includes(q) ||
c.department.toLowerCase().includes(q) ||
c.role.toLowerCase().includes(q)
(c.department ?? '').toLowerCase().includes(q) ||
(c.role ?? '').toLowerCase().includes(q)
);
}
return true;