From d04a68f190fb696e67cab603d26a63b8ceb042a0 Mon Sep 17 00:00:00 2001 From: Will Soto Date: Fri, 7 Jun 2019 08:46:03 -0400 Subject: [PATCH] fix(core): guard against missing options Signed-off-by: Will Soto --- lib/core.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/core.ts b/lib/core.ts index 8a682998..16587752 100644 --- a/lib/core.ts +++ b/lib/core.ts @@ -117,6 +117,10 @@ export class ObjectionCoreModule { }; } + if (!options.useClass || !options.useExisting) { + throw new Error("Invalid configuration"); + } + return { provide: OBJECTION_MODULE_OPTIONS, async useFactory(