Skip to content

Commit

Permalink
fix(rules): null access in the no-angular-classes rule
Browse files Browse the repository at this point in the history
Safeguard against null access when using gulp-eslint runner.
  • Loading branch information
alecxe authored Jun 17, 2016
2 parents 8a54521 + fa7f65f commit 0052c77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rules/no-angular-classes.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = function (context) {

return {
'CallExpression': function (node) {
if (node.arguments) {
if (node.arguments && node.arguments.length && node.arguments[0].hasOwnProperty('value')) {
if (isCSSLocator(node)) {
for (var i = 0; i < prohibitedClasses.length; i++) {
if (node.arguments[0].value.indexOf(prohibitedClasses[i]) >= 0) {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/use-angular-locators.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = function (context) {

return {
'CallExpression': function (node) {
if (node.arguments) {
if (node.arguments && node.arguments.length && node.arguments[0].hasOwnProperty('value')) {
if (isCSSLocator(node)) {
Object.keys(attributeToLocatorMap).forEach(function (key) {
if (node.arguments[0].value.indexOf(key) >= 0) {
Expand Down

0 comments on commit 0052c77

Please sign in to comment.