Skip to content

Commit c7b96f7

Browse files
authored
Fix #23 return early if not called on a object
1 parent 8d75eb1 commit c7b96f7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/rules/no-assigning-return-values.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ function isCypressCommandDeclaration(declarator) {
3535
if (!declarator.init.callee) { return; }
3636

3737
let object = declarator.init.callee.object;
38+
39+
if (!object) { return; }
40+
3841
while (object.callee) {
3942
object = object.callee.object;
4043
}

0 commit comments

Comments
 (0)