diff --git a/index.js b/index.js index cdfd120..6604a66 100644 --- a/index.js +++ b/index.js @@ -182,7 +182,7 @@ module.exports = function(results) { var column = message.column || 0; var arrow = ''; - var hasSource = message.source !== undefined && message.source.length < 1000; + var hasSource = message.source && message.source.length < 1000; if (hasSource) { for (var i = 0; i < message.column; i++) { if (message.source.charAt(i) === '\t') { diff --git a/test/fixtures/fatal/results.json b/test/fixtures/fatal/results.json index 9ed4d7c..6031bf6 100644 --- a/test/fixtures/fatal/results.json +++ b/test/fixtures/fatal/results.json @@ -5,6 +5,7 @@ { "fatal": true, "severity": 2, + "source": null, "message": "Unexpected token {", "line": 3, "column": 13