Skip to content

Commit

Permalink
Fix #23 return early if not called on a object
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeapage authored Nov 4, 2018
1 parent 8d75eb1 commit c7b96f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/rules/no-assigning-return-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ function isCypressCommandDeclaration(declarator) {
if (!declarator.init.callee) { return; }

let object = declarator.init.callee.object;

if (!object) { return; }

while (object.callee) {
object = object.callee.object;
}
Expand Down

0 comments on commit c7b96f7

Please sign in to comment.