Skip to content

Commit

Permalink
test quick fix for splitPath is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelrahmanHafez committed Nov 17, 2021
1 parent 97434b8 commit b41cd1e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,12 @@ Document.prototype.$__buildDoc = function(obj, fields, skipId, exclude, hasInclu
}
}

const path = this.$__schema.paths[p].splitPath();
const path = (typeof this.$__schema.paths[p].splitPath) === 'function' && this.$__schema.paths[p].splitPath();
if (!path) {
console.log(this.$__schema.paths[p]);
continue;
}

const len = path.length;
const last = len - 1;
let curPath = '';
Expand Down

0 comments on commit b41cd1e

Please sign in to comment.