Skip to content

Commit

Permalink
fix: Don't crash when the table is empty, skip it
Browse files Browse the repository at this point in the history
  • Loading branch information
sapegin committed Jul 31, 2020
1 parent a7dfc9c commit 463a0ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/antbear.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ function printMetric(value, caption) {
}

function printObject(object, caption) {
const keyColWidth = longest(Object.keys(object)).length;
const keys = Object.keys(object);
if (keys.length === 0) {
return;
}

const keyColWidth = longest(keys).length;
const valueColWidth = longest(Object.values(object)).length;
const rows = sortBy(Object.entries(object), ([, value]) => value).reverse();

Expand Down

0 comments on commit 463a0ae

Please sign in to comment.