diff -r 9fe8cfa14542 -r 2cba3f220ef5 eric7/UI/PythonDisViewer.py --- a/eric7/UI/PythonDisViewer.py Wed Apr 13 19:49:25 2022 +0200 +++ b/eric7/UI/PythonDisViewer.py Thu Apr 14 08:53:34 2022 +0200 @@ -385,7 +385,7 @@ if instr.starts_line: itm.setData(0, self.StartLineRole, instr.starts_line) itm.setData(0, self.EndLineRole, instr.starts_line) - else: + elif parent is not None: # get line from parent (= start line) lineno = parent.data(0, self.StartLineRole) itm.setData(0, self.StartLineRole, lineno)