Skip to content

Commit

Permalink
Fix issue #3240
Browse files Browse the repository at this point in the history
  • Loading branch information
WillyLiaoWH committed Mar 28, 2022
1 parent 5bc571d commit 03d56dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/no-unused-state.js
Expand Up @@ -371,7 +371,7 @@ module.exports = {
}
const scope = childScope.variableScope.childScopes.find((x) => x.block === node.value);
const stateArg = node.value.params[1]; // probably "state"
if (!scope.variables) {
if (!scope || !scope.variables) {
return;
}
const argVar = scope.variables.find((x) => x.name === stateArg.name);
Expand Down

0 comments on commit 03d56dc

Please sign in to comment.