Skip to content

Commit 8cc9a6b

Browse files
committed
fix: addUser arg handling
1 parent 7233dbe commit 8cc9a6b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/legacy_wrappers/admin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ module.exports.makeLegacyAdmin = function (baseClass) {
1717
? password
1818
: undefined;
1919
options =
20-
typeof options !== 'function'
20+
options != null && typeof options === 'object'
2121
? options
22-
: typeof password !== 'function'
22+
: password != null && typeof password === 'object'
2323
? password
2424
: undefined;
2525
return maybeCallback(super.addUser(username, password, options), callback);

src/legacy_wrappers/db.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ module.exports.makeLegacyDb = function (baseClass) {
2929
? password
3030
: undefined;
3131
options =
32-
typeof options !== 'function'
32+
options != null && typeof options === 'object'
3333
? options
34-
: typeof password !== 'function'
34+
: password != null && typeof password === 'object'
3535
? password
3636
: undefined;
3737
return maybeCallback(super.addUser(username, password, options), callback);

0 commit comments

Comments
 (0)