From 3254c31e028ca32a8b00753dabde3f984f8a1524 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sun, 30 May 2021 01:44:15 +0200 Subject: :sparkles: user avatar --- src/util/instanceOf.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/util/instanceOf.ts') diff --git a/src/util/instanceOf.ts b/src/util/instanceOf.ts index b67bde27..93a92805 100644 --- a/src/util/instanceOf.ts +++ b/src/util/instanceOf.ts @@ -74,10 +74,9 @@ export function instanceOf( ): Boolean { if (!ref) ref = { obj: null, key: "" }; if (!path) path = "body"; + if (!type) return true; // no type was specified try { - if (!type) return true; // no type was specified - if (value == null) { if (optional) return true; throw new FieldError("BASE_TYPE_REQUIRED", req.t("common:field.BASE_TYPE_REQUIRED")); -- cgit 1.5.1