Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Populate can bail out too early if empty array in the field being populated #1055

Closed
wants to merge 1 commit into from

Conversation

daveh957
Copy link

Populate could bail out too early if the first document retrieved from the parent model contained an empty array in the field used for populating the child model. The _populate method will invoke the next function immediately in this event rather than being delayed by a database read causing the loop to end immediately. In order to fix this, I wrapped the call to _populate in "process.nextTick()".

Populate could bail out too early if the first document retrieved from the parent model contained an empty array in the field used for populating the child model.
@jfremy
Copy link
Contributor

jfremy commented Aug 15, 2012

I have an alternate fix for this bug in #1053
I have no idea if one is better than the other.

aheckmann added a commit that referenced this pull request Aug 17, 2012
@aheckmann
Copy link
Collaborator

merged, thanks!

@aheckmann aheckmann closed this Aug 17, 2012
aheckmann added a commit that referenced this pull request Aug 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants