From c7b96f7776e1c5e5035dc48fcaa657be0ee9479c Mon Sep 17 00:00:00 2001 From: Luke Page Date: Sun, 4 Nov 2018 12:50:22 +0100 Subject: [PATCH] Fix #23 return early if not called on a object --- lib/rules/no-assigning-return-values.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/rules/no-assigning-return-values.js b/lib/rules/no-assigning-return-values.js index 05b9a2d5..f35570f6 100644 --- a/lib/rules/no-assigning-return-values.js +++ b/lib/rules/no-assigning-return-values.js @@ -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; }