1 files changed, 4 insertions, 1 deletions
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
|