Skip to content

Commit 6da5807

Browse files
authored
Fix jsx-tag-spacing crash when options object isn't passed (fixes #955)
2 parents 5952dbf + de9a357 commit 6da5807

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/rules/jsx-tag-spacing.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,11 @@ module.exports = {
204204
beforeSelfClosing: 'always',
205205
afterOpening: 'never'
206206
};
207-
for (var key in options) {
208-
if (options.hasOwnProperty(key) && context.options[0].hasOwnProperty(key)) {
209-
options[key] = context.options[0][key];
207+
if (context.options[0]) {
208+
for (var key in options) {
209+
if (options.hasOwnProperty(key) && context.options[0].hasOwnProperty(key)) {
210+
options[key] = context.options[0][key];
211+
}
210212
}
211213
}
212214

0 commit comments

Comments
 (0)