From b5722fd3fd9a24e74301fc47ba56c39c3e7d65f4 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Thu, 4 Mar 2021 09:27:14 +0100 Subject: :construction: /channels/messages --- src/util/instanceOf.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/util/instanceOf.ts') diff --git a/src/util/instanceOf.ts b/src/util/instanceOf.ts index be7124d4..b5b2f587 100644 --- a/src/util/instanceOf.ts +++ b/src/util/instanceOf.ts @@ -66,8 +66,11 @@ export function instanceOf( errors = {}, req, ref, - }: { path?: string; optional?: boolean; errors?: any; req: Request; ref: { key: string | number; obj: any } } + }: { path?: string; optional?: boolean; errors?: any; req: Request; ref?: { key: string | number; obj: any } } ): Boolean { + if (!ref) ref = { obj: null, key: "" }; + if (!path) path = "body"; + try { if (!type) return true; // no type was specified -- cgit 1.5.1