Skip to content

Commit

Permalink
(#2) - fix call stack exceeded in pouch v5
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson committed Oct 23, 2015
1 parent 7beecd4 commit ca43145
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ staticSecurityWrappers.destroy = requiresServerAdmin;
staticSecurityWrappers.replicate = function (original, args) {
//emulate replicate.to/replicate.from
var PouchDB = args.base;
args.db = new PouchDB(args.source);
args.db = args.source instanceof PouchDB ? args.source : new PouchDB(args.source);
//and call its handler
var handler = securityWrappers['replicate.to'];
return handler(original, args);
Expand Down

0 comments on commit ca43145

Please sign in to comment.