Skip to content

Commit bc21555

Browse files
committedJul 29, 2018
fix(document): handle overwriting $session in execPopulate()
Re: #6754
1 parent f3af885 commit bc21555

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎lib/document.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -2771,8 +2771,13 @@ Document.prototype.populate = function populate() {
27712771
if (this.$session() != null) {
27722772
const session = this.$session();
27732773
paths.forEach(path => {
2774-
path.options = path.options || {};
2775-
path.options.session = session;
2774+
if (path.options == null) {
2775+
path.options = { session: session };
2776+
return;
2777+
}
2778+
if (!('session' in path.options)) {
2779+
path.options.session = session;
2780+
}
27762781
});
27772782
}
27782783

0 commit comments

Comments
 (0)
Please sign in to comment.