Skip to content

Commit

Permalink
fix(core): guard against missing options
Browse files Browse the repository at this point in the history
Signed-off-by: Will Soto <willsoto@users.noreply.github.com>
  • Loading branch information
willsoto committed Jun 7, 2019
1 parent 6042ce9 commit d04a68f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ export class ObjectionCoreModule {
};
}

if (!options.useClass || !options.useExisting) {
throw new Error("Invalid configuration");
}

return {
provide: OBJECTION_MODULE_OPTIONS,
async useFactory(
Expand Down

0 comments on commit d04a68f

Please sign in to comment.