From 3994de0dd3cc8caac89d98d5655624fe8c025a37 Mon Sep 17 00:00:00 2001
From: Punn Siriphanthong
Date: Mon, 26 Oct 2020 14:06:56 +0700
Subject: [PATCH] fix error when source not exist
---
eslint-formatter-rdjson/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eslint-formatter-rdjson/index.js b/eslint-formatter-rdjson/index.js
index dc8fbd2..34eab2f 100644
--- a/eslint-formatter-rdjson/index.js
+++ b/eslint-formatter-rdjson/index.js
@@ -79,7 +79,7 @@ module.exports = function (results, data) {
results.forEach(result => {
const filePath = result.filePath;
const source = result.source;
- const sourceLines = result.source.split('\n');
+ const sourceLines = source ? source.split('\n') : [];
result.messages.forEach(msg => {
let diagnostic = {
message: msg.message,