Skip to content

Commit

Permalink
Fix jsx-tag-spacing crash when options object isn't passed
Browse files Browse the repository at this point in the history
  • Loading branch information
daltones committed Nov 14, 2016
1 parent 5952dbf commit de9a357
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/rules/jsx-tag-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,11 @@ module.exports = {
beforeSelfClosing: 'always',
afterOpening: 'never'
};
for (var key in options) {
if (options.hasOwnProperty(key) && context.options[0].hasOwnProperty(key)) {
options[key] = context.options[0][key];
if (context.options[0]) {
for (var key in options) {
if (options.hasOwnProperty(key) && context.options[0].hasOwnProperty(key)) {
options[key] = context.options[0][key];
}
}
}

Expand Down

0 comments on commit de9a357

Please sign in to comment.