Skip to content

Commit

Permalink
Fixing exception throw if a table has 0 rows when exported
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Pilafian authored and Alex Pilafian committed Jul 17, 2018
1 parent ac2a278 commit ba4e5b1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ module.exports = function(conf){
}).then(function () {

_.each(tables, function(table_name){

if(tables_sizes[table_name] == 0)
return;

var output_def = q.defer();
output_promises.push(output_def.promise);
var pages = parseInt(tables_sizes[table_name] / results_per_page);
Expand Down Expand Up @@ -245,10 +249,12 @@ module.exports = function(conf){
return q.all(output_promises)
}, error_out)
.then(function(){
done();
client.release();
pool.end().then(function(){
events.next({message: "success"});
});
done();

}, error_out);

});
Expand Down

0 comments on commit ba4e5b1

Please sign in to comment.