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

Commit d2c62f20 by Mick Hansen

Merge pull request #1849 from hycheung0509/1.7.0

[Ref #1824] Fix TypeError if got empty rows from findAndCountAll() with group
2 parents cb3950cf 3f86e866
Showing with 2 additions and 1 deletions
...@@ -617,7 +617,8 @@ module.exports = (function() { ...@@ -617,7 +617,8 @@ module.exports = (function() {
options.limit = null options.limit = null
this.find(options, {raw: true, transaction: options.transaction}).proxy(emitter, {events: ['sql', 'error']}).success(function (result) { 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() }.bind(this)).run()
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!