From 40df9c4c0882fbb692d99f6dcd3d2b31fed558c0 Mon Sep 17 00:00:00 2001 From: shancheas Date: Wed, 9 Jul 2025 11:29:13 +0700 Subject: [PATCH] fix: add null check in sanitizePhoneNumber helper to prevent errors --- src/modules/queue/domain/helpers/time.helper.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/queue/domain/helpers/time.helper.ts b/src/modules/queue/domain/helpers/time.helper.ts index 1eeecba..0335208 100644 --- a/src/modules/queue/domain/helpers/time.helper.ts +++ b/src/modules/queue/domain/helpers/time.helper.ts @@ -15,6 +15,7 @@ export function phoneNumberOnly(phone: string): string { } export function sanitizePhoneNumber(phone: string): string { + if (!phone) return phone; // Remove all non-numeric characters first const cleanPhone = phone.replace(/[^0-9]/g, '');