Skip to content

Commit 52b6039

Browse files
author
Jessica Lord
committed
fix(url parser): add check for options as cb
1 parent 861761e commit 52b6039

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/url_parser.js

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ var ReadPreference = require('./read_preference'),
88
dns = require('dns');
99

1010
module.exports = function(url, options, callback) {
11+
if (typeof options === 'function') (callback = options), (options = {});
12+
options = options || {};
13+
1114
var result = parser.parse(url, true);
1215
if (result.protocol !== 'mongodb:' && result.protocol !== 'mongodb+srv:') {
1316
return callback(new Error('invalid schema, expected mongodb or mongodb+srv'));

0 commit comments

Comments
 (0)