summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--astroid/helpers.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/astroid/helpers.py b/astroid/helpers.py
index a7764d7a..96e43de0 100644
--- a/astroid/helpers.py
+++ b/astroid/helpers.py
@@ -252,6 +252,7 @@ def object_len(node, context=None):
if (
isinstance(node_frame, scoped_nodes.FunctionDef)
and node_frame.name == "__len__"
+ and inferred_node is not None
and inferred_node._proxied == node_frame.parent
):
message = (