Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #5 from OakNorthAI/dev
Browse files Browse the repository at this point in the history
Fix null pointer bug
  • Loading branch information
Matthias Görgens authored Oct 16, 2019
2 parents d9fc457 + 5425b92 commit 777fd9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/no-literal-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ module.exports = {
{
const element = getNearestAncestor(node, 'JSXOpeningElement');
const attribute = getNearestAncestor(node, 'JSXAttribute');
if (element !== null) {
if (element !== null && attribute !== null) {
complaints.set(node, {
node,
message: "Forbidden literal string {{string}} as value for attribute '{{attribute}}' for tag '{{tag}}' in {{ code }} ",
Expand Down

0 comments on commit 777fd9e

Please sign in to comment.