Skip to content

Commit c418ab8

Browse files
committed
Merge pull request sequelize#1849 from hycheung0509/1.7.0
[Ref sequelize#1824] Fix TypeError if got empty rows from findAndCountAll() with group
2 parents e54ceca + 2f3460a commit c418ab8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/dao-factory.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,8 @@ module.exports = (function() {
617617
options.limit = null
618618

619619
this.find(options, {raw: true, transaction: options.transaction}).proxy(emitter, {events: ['sql', 'error']}).success(function (result) {
620-
emitter.emit('success', parseInt(result.count, 10))
620+
var count = (result && result.count) ? parseInt(result.count, 10) : 0
621+
emitter.emit('success', count)
621622
})
622623
}.bind(this)).run()
623624
}

0 commit comments

Comments
 (0)