Skip to content

Commit 0052c77

Browse files
authored
fix(rules): null access in the no-angular-classes rule
Safeguard against null access when using gulp-eslint runner.
2 parents 8a54521 + fa7f65f commit 0052c77

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/rules/no-angular-classes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = function (context) {
2121

2222
return {
2323
'CallExpression': function (node) {
24-
if (node.arguments) {
24+
if (node.arguments && node.arguments.length && node.arguments[0].hasOwnProperty('value')) {
2525
if (isCSSLocator(node)) {
2626
for (var i = 0; i < prohibitedClasses.length; i++) {
2727
if (node.arguments[0].value.indexOf(prohibitedClasses[i]) >= 0) {

lib/rules/use-angular-locators.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = function (context) {
1616

1717
return {
1818
'CallExpression': function (node) {
19-
if (node.arguments) {
19+
if (node.arguments && node.arguments.length && node.arguments[0].hasOwnProperty('value')) {
2020
if (isCSSLocator(node)) {
2121
Object.keys(attributeToLocatorMap).forEach(function (key) {
2222
if (node.arguments[0].value.indexOf(key) >= 0) {

0 commit comments

Comments
 (0)