1602 / jugglingdb

Multi-database ORM for nodejs: redis, mongodb, mysql, sqlite3, postgresql, arango, in-memory...
http://1602.github.io/jugglingdb/
2.05k stars 241 forks source link

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

Open Alvansea opened 10 years ago

Alvansea commented 10 years ago

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