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

callback of AbstractClass.include may be executed several times #414

Open
Alvansea opened this issue Aug 3, 2014 · 0 comments
Open

callback of AbstractClass.include may be executed several times #414

Alvansea opened this issue Aug 3, 2014 · 0 comments

Comments

@Alvansea
Copy link

Alvansea commented Aug 3, 2014

/lib/include.js line 25: AbstractClass.include = function (objects, include, cb) {
If objects length is 0, and include is an array with multiple items, the cb will be executed several times.
While integrating with Express, this will cause the known issue "Can't set headers after they are sent."

To fix it, my suggestion is to add "return" before cb in line 53 as: return cb(null, objects);

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

No branches or pull requests

1 participant