Skip to content

Commit

Permalink
fix(mongo client): do not connect if url parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jessica Lord committed Nov 20, 2017
1 parent 4427d7b commit cd10084
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/mongo_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,8 @@ var connect = function(self, url, options, callback) {
}

parse(url, options, function(err, object) {
if (err) return console.log(err);
// Do not attempt to connect if parsing error
if (err) return callback(err);

// Parse the string
var _finalOptions = createUnifiedOptions({}, object);
Expand Down

0 comments on commit cd10084

Please sign in to comment.