BreakPointModel, WatchPointModel: fixed a potential issue deleting breakpoints/watchpoints.

Wed, 29 May 2019 19:44:55 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 29 May 2019 19:44:55 +0200
changeset 7025
83e110e3fcc6
parent 7024
946f43137421
child 7026
fbb685ce95cc

BreakPointModel, WatchPointModel: fixed a potential issue deleting breakpoints/watchpoints.

eric6/Debugger/BreakPointModel.py file | annotate | diff | comparison | revisions
eric6/Debugger/WatchPointModel.py file | annotate | diff | comparison | revisions
--- a/eric6/Debugger/BreakPointModel.py	Fri May 24 19:33:04 2019 +0200
+++ b/eric6/Debugger/BreakPointModel.py	Wed May 29 19:44:55 2019 +0200
@@ -260,9 +260,10 @@
                 rows.append(index.row())
         rows.sort(reverse=True)
         for row in rows:
-            self.beginRemoveRows(QModelIndex(), row, row)
-            del self.breakpoints[row]
-            self.endRemoveRows()
+            if row < len(self.breakpoints):
+                self.beginRemoveRows(QModelIndex(), row, row)
+                del self.breakpoints[row]
+                self.endRemoveRows()
 
     def deleteAll(self):
         """
--- a/eric6/Debugger/WatchPointModel.py	Fri May 24 19:33:04 2019 +0200
+++ b/eric6/Debugger/WatchPointModel.py	Wed May 29 19:44:55 2019 +0200
@@ -243,9 +243,10 @@
                 rows.append(index.row())
         rows.sort(reverse=True)
         for row in rows:
-            self.beginRemoveRows(QModelIndex(), row, row)
-            del self.watchpoints[row]
-            self.endRemoveRows()
+            if row < len(self.breakpoints):
+                self.beginRemoveRows(QModelIndex(), row, row)
+                del self.watchpoints[row]
+                self.endRemoveRows()
 
     def deleteAll(self):
         """

eric ide

mercurial