Skip to content

Commit

Permalink
fix: dont print codeFrame if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Nov 13, 2017
1 parent 0994dba commit b44dccd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/LineWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,11 @@ class LineWriter {

const codeFrame = formatCodeFrame(file, row, column);

push('');
codeFrame.split('\n').forEach((codeFrameLine) => pushCodeFrameLine(codeFrameLine));
push('');
if (codeFrame) {
push('');
codeFrame.split('\n').forEach((codeFrameLine) => pushCodeFrameLine(codeFrameLine));
push('');
}
}
} else {
pushTraceLine(line);
Expand Down

0 comments on commit b44dccd

Please sign in to comment.