Skip to content

Commit

Permalink
Update lib/connection.js
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 authored Aug 30, 2022
1 parent c4935c7 commit 53d4f38
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,9 @@ Connection.prototype.model = function(name, schema, collection, options) {
return sub;
}

model = this.models[name];
if (arguments.length === 1) {
return this.models[name];
}

if (!model) {
throw new MongooseError.MissingSchemaError(name);
Expand Down

0 comments on commit 53d4f38

Please sign in to comment.