From c8f2e6ce353b67cef6a3f6adefdd8e8795b074fc Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Wed, 19 Oct 2016 01:19:45 +0100 Subject: [PATCH] :art: Protect against unhandled error --- lib/rules/space-before-colon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/space-before-colon.js b/lib/rules/space-before-colon.js index 0d82b468..f61791fa 100644 --- a/lib/rules/space-before-colon.js +++ b/lib/rules/space-before-colon.js @@ -14,7 +14,7 @@ module.exports = { if (delimiter.content === ':') { var previous = parent.content[i - 1]; - if (previous.is('space')) { + if (previous && previous.is('space')) { if (!parser.options.include) { result = helpers.addUnique(result, { 'ruleId': parser.rule.name,