From ccbc61fa3d883946604883db8a7bf8f8dba7a475 Mon Sep 17 00:00:00 2001 From: vindard <17693119+vindard@users.noreply.github.com> Date: Wed, 27 Dec 2023 12:48:49 -0400 Subject: [PATCH] fix: check if 'lineTypeIntelligence' property exists --- core/api/src/services/twilio-service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/api/src/services/twilio-service.ts b/core/api/src/services/twilio-service.ts index 6352005640b..59dbd3bc522 100644 --- a/core/api/src/services/twilio-service.ts +++ b/core/api/src/services/twilio-service.ts @@ -57,6 +57,9 @@ export const TwilioClient = (): IPhoneProviderService => { fields: "line_type_intelligence", }) // https://www.twilio.com/docs/lookup/v2-api/line-type-intelligence#type-property-values + if (!lookup.lineTypeIntelligence) { + return new InvalidTypePhoneProviderError("type not found") + } if (lookup.lineTypeIntelligence.type === "nonFixedVoip") { return new InvalidTypePhoneProviderError("nonFixedVoip") }