不要怂,就是干,撸起袖子干!

Commit 3f86e866 by Oscar Cheung

[Ref #1824] Fix TypeError if got empty rows from findAndCountAll() with group.

1 parent cb3950cf
Showing with 2 additions and 1 deletions
......@@ -617,7 +617,8 @@ module.exports = (function() {
options.limit = null
this.find(options, {raw: true, transaction: options.transaction}).proxy(emitter, {events: ['sql', 'error']}).success(function (result) {
emitter.emit('success', parseInt(result.count, 10))
var count = (result && result.count) ? parseInt(result.count, 10) : 0
emitter.emit('success', count)
})
}.bind(this)).run()
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!