From c419fa48cf043abc2782ff0788d3e792260163d3 Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Fri, 2 Jan 2026 20:36:25 -0600 Subject: [PATCH] fix(call): ensure safe access to call history, announces, voicemails, and contacts by providing default values --- meshchatx/src/frontend/components/call/CallPage.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meshchatx/src/frontend/components/call/CallPage.vue b/meshchatx/src/frontend/components/call/CallPage.vue index ffbbd93..e4da0f5 100644 --- a/meshchatx/src/frontend/components/call/CallPage.vue +++ b/meshchatx/src/frontend/components/call/CallPage.vue @@ -1690,7 +1690,7 @@ export default { }` ); - const newItems = response.data.call_history; + const newItems = response.data.call_history || []; if (loadMore) { this.callHistory = [...this.callHistory, ...newItems]; } else { @@ -1728,7 +1728,7 @@ export default { }, }); - const newItems = response.data.announces; + const newItems = response.data.announces || []; if (loadMore) { this.discoveryAnnounces = [...this.discoveryAnnounces, ...newItems]; } else { @@ -1923,8 +1923,8 @@ export default { const response = await window.axios.get("/api/v1/telephone/voicemails", { params: { search: this.voicemailSearch }, }); - this.voicemails = response.data.voicemails; - this.unreadVoicemailsCount = response.data.unread_count; + this.voicemails = response.data.voicemails || []; + this.unreadVoicemailsCount = response.data.unread_count || 0; } catch (e) { console.log(e); } @@ -1940,7 +1940,7 @@ export default { const response = await window.axios.get("/api/v1/telephone/contacts", { params: { search: this.contactsSearch }, }); - this.contacts = response.data; + this.contacts = response.data.contacts || (Array.isArray(response.data) ? response.data : []); } catch (e) { console.log(e); }