Skip to content

Commit

Permalink
chore: fix test error
Browse files Browse the repository at this point in the history
  • Loading branch information
akulsr0 committed Dec 24, 2022
1 parent 0c932e0 commit 0f4f518
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/jsx-no-leaked-render.js
Expand Up @@ -61,7 +61,7 @@ function ruleFixer(context, fixStrategy, fixer, reportedNode, leftNode, rightNod
if (isParenthesized(context, node)) {
nodeText = `(${nodeText})`;
}
if(node.parent.type === 'ConditionalExpression' && node.parent.consequent.value === false) {
if(node.parent && node.parent.type === 'ConditionalExpression' && node.parent.consequent.value === false) {
return `${getIsCoerceValidNestedLogicalExpression(node) ? '' : '!'}${nodeText}`;
}
return `${getIsCoerceValidNestedLogicalExpression(node) ? '' : '!!'}${nodeText}`;
Expand Down

0 comments on commit 0f4f518

Please sign in to comment.