jugglingdb icon indicating copy to clipboard operation
jugglingdb copied to clipboard

callback of AbstractClass.include may be executed several times

Open Alvansea opened this issue 9 years ago • 0 comments

/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);

Alvansea avatar Aug 03 '14 10:08 Alvansea