summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-30 01:44:15 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-30 01:44:15 +0200
commit3254c31e028ca32a8b00753dabde3f984f8a1524 (patch)
tree1cce08ad3d7c168a0af2354f021687fe6ee2795b /src/util
parent:sparkles: message attachments (diff)
downloadserver-3254c31e028ca32a8b00753dabde3f984f8a1524.tar.xz
:sparkles: user avatar
Diffstat (limited to 'src/util')
-rw-r--r--src/util/instanceOf.ts3
1 files changed, 1 insertions, 2 deletions
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"));