Skip to content

Commit 9a671f9

Browse files
authored
fix: add arg validation to ensureValidPhoneNumber (calcom#21259)
1 parent 3bc9fa1 commit 9a671f9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

packages/features/bookings/lib/getBookingResponsesSchema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const bookingResponsesDbSchema = z.record(dbReadResponseSchema);
1717
const catchAllSchema = bookingResponsesDbSchema;
1818

1919
const ensureValidPhoneNumber = (value: string) => {
20+
if (!value) return "";
2021
// + in URL could be replaced with space, so we need to replace it back
2122
// Replace the space(s) in the beginning with + as it is supposed to be provided in the beginning only
2223
return value.replace(/^ +/, "+");

0 commit comments

Comments
 (0)