Skip to content

Commit

Permalink
Fix jsx-tag-spacing crash when options object isn't passed (fixes #955)
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcr authored Nov 15, 2016
2 parents 5952dbf + de9a357 commit 6da5807
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 6da5807

Please sign in to comment.