Bug on wire deletion from a connector fixed
authorlbessard
Fri, 03 Aug 2007 18:00:24 +0200
changeset 60 ef940f442b8d
parent 59 af079a11837b
child 61 dc7142ae9438
Bug on wire deletion from a connector fixed
graphics/GraphicCommons.py
--- a/graphics/GraphicCommons.py	Thu Aug 02 17:54:42 2007 +0200
+++ b/graphics/GraphicCommons.py	Fri Aug 03 18:00:24 2007 +0200
@@ -1442,10 +1442,11 @@
     
     # Unconnects wire start point
     def UnConnectStartPoint(self, delete = False):
-        self.StartConnected.UnConnect(self, False)
         if delete:
+            self.StartConnected = None
             self.Delete()
-        else:
+        elif self.StartConnected:
+            self.StartConnected.UnConnect(self, unconnect = False)
             self.StartConnected = None
     
     # Moves the wire end point and update the wire points
@@ -1474,10 +1475,11 @@
     
     # Unconnects wire end point
     def UnConnectEndPoint(self, delete = False):
-        self.EndConnected.UnConnect(self, False)
         if delete:
+            self.EndConnected = None
             self.Delete()
-        else:
+        elif self.EndConnected:
+            self.EndConnected.UnConnect(self, unconnect = False)
             self.EndConnected = None
     
     # Moves the wire segment given by its index