From 8b64df51280aa21ce2788452f93818dccddd1a30 Mon Sep 17 00:00:00 2001 From: Jeff Gauthier Date: Tue, 7 Nov 2023 14:32:14 -0500 Subject: [PATCH] Playing defense when retrieving AORs --- src/api/amid.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/amid.ts b/src/api/amid.ts index 7557afc4..e17db856 100644 --- a/src/api/amid.ts +++ b/src/api/amid.ts @@ -10,7 +10,7 @@ export default ((client: ApiRequester, baseUrl: string): AmiD => ({ getAors: async (endpoint: string) => { const rawEvents = await client.post(`${baseUrl}/action/PJSIPShowEndpoint`, { Endpoint: endpoint, - }); + }) || []; return rawEvents.filter((event: Record) => event.Event === 'ContactStatusDetail'); }, }));