Skip to content

Commit

Permalink
Fix #147 (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasilcenko authored and daffl committed Mar 27, 2018
1 parent ee27a27 commit 4b09e99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class Service {

if (!params.knex) { this.knexify(countQuery, query); }

return countQuery.then(count => count[0].total).then(executeQuery).catch(errorHandler);
return countQuery.then(count => count[0] ? count[0].total : 0).then(executeQuery).catch(errorHandler);
}

return executeQuery().catch(errorHandler);
Expand Down

0 comments on commit 4b09e99

Please sign in to comment.