From a7ed9f981a411bdd6915f92c029d475fcc1d2fee Mon Sep 17 00:00:00 2001 From: Nevo David Date: Thu, 31 Jul 2025 10:42:46 +0700 Subject: [PATCH] fix: endswith --- libraries/helpers/src/utils/valid.url.path.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/helpers/src/utils/valid.url.path.ts b/libraries/helpers/src/utils/valid.url.path.ts index d7c18931..469f8229 100644 --- a/libraries/helpers/src/utils/valid.url.path.ts +++ b/libraries/helpers/src/utils/valid.url.path.ts @@ -8,11 +8,11 @@ import { export class ValidUrlExtension implements ValidatorConstraintInterface { validate(text: string, args: ValidationArguments) { return ( - text.endsWith('.png') || - text.endsWith('.jpg') || - text.endsWith('.jpeg') || - text.endsWith('.gif') || - text.endsWith('.mp4') + text?.endsWith('.png') || + text?.endsWith('.jpg') || + text?.endsWith('.jpeg') || + text?.endsWith('.gif') || + text?.endsWith('.mp4') ); }