From 27b32fb2f9a63a6be2dfaa126172587de5745d88 Mon Sep 17 00:00:00 2001 From: Landon Abney Date: Sun, 17 Sep 2017 23:45:00 -0700 Subject: [PATCH] Verify that a rule has a meta property before accessing Verify that a rule has a `meta` property before attempting to access it to see if the rule is fixable or not. Fixes #1023 --- src/worker.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/worker.js b/src/worker.js index 8994452a..39d4ed7b 100644 --- a/src/worker.js +++ b/src/worker.js @@ -29,7 +29,10 @@ function updateFixableRules(linter) { // Build a set of fixable rules based on the rules loaded in the provided linter const currentRules = new Set() linter.getRules().forEach((props, rule) => { - if (Object.prototype.hasOwnProperty.call(props.meta, 'fixable')) { + if ( + Object.prototype.hasOwnProperty.call(props, 'meta') && + Object.prototype.hasOwnProperty.call(props.meta, 'fixable') + ) { currentRules.add(rule) } })