Skip to content

Commit

Permalink
fix(MongoMemoryReplSet): _initReplSet: throw error if "this.servers.l…
Browse files Browse the repository at this point in the history
…ength" is "<= 0"

- throw if number is 0 or less, not just falsy
  • Loading branch information
hasezoey committed Oct 12, 2020
1 parent 127102e commit 019b118
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ export class MongoMemoryReplSet extends EventEmitter {
throw new Error('Not in init phase.');
}
log('Initializing replica set.');
if (!this.servers.length) {
if (this.servers.length <= 0) {
throw new Error('One or more servers are required.');
}
const uris = this.servers.map((server) => server.getUri());
Expand Down

0 comments on commit 019b118

Please sign in to comment.