--- a/eric6/QScintilla/EditorOutlineModel.py Sun Apr 11 16:53:48 2021 +0200 +++ b/eric6/QScintilla/EditorOutlineModel.py Sun Apr 11 18:45:10 2021 +0200 @@ -243,9 +243,11 @@ elif hasattr(child, "linenos"): if lineno in child.linenos(): return child - elif hasattr(child, "lineno"): - if lineno == child.lineno(): - return child + elif ( + hasattr(child, "lineno") and + lineno == child.lineno() + ): + return child else: return None