# HG changeset patch
# User Edouard Tisserant
# Date 1633509906 -7200
# Node ID dd49e4055a10b44f79970ba5c6c7ac94b1e78052
# Parent  e6c758e41f828cd07eaf08587ebf256b0802c463
Fixed two exceptions happening when interacting with viewer(s) in debug mode, when debug data is still not initialized.

diff -r e6c758e41f82 -r dd49e4055a10 graphics/GraphicCommons.py
--- a/graphics/GraphicCommons.py	Thu Sep 16 09:40:36 2021 +0200
+++ b/graphics/GraphicCommons.py	Wed Oct 06 10:45:06 2021 +0200
@@ -1063,6 +1063,8 @@
 
     # Returns the RedrawRect
     def GetRedrawRect(self, movex=0, movey=0):
+        if self.ParentBlock == None:
+            return None
         parent_pos = self.ParentBlock.GetPosition()
         x = min(parent_pos[0] + self.Pos.x, parent_pos[0] + self.Pos.x + self.Direction[0] * CONNECTOR_SIZE)
         y = min(parent_pos[1] + self.Pos.y, parent_pos[1] + self.Pos.y + self.Direction[1] * CONNECTOR_SIZE)
diff -r e6c758e41f82 -r dd49e4055a10 graphics/LD_Objects.py
--- a/graphics/LD_Objects.py	Thu Sep 16 09:40:36 2021 +0200
+++ b/graphics/LD_Objects.py	Wed Oct 06 10:45:06 2021 +0200
@@ -405,6 +405,8 @@
             if self.Value is None:
                 self.Value = False
             spreading = self.Input.ReceivingCurrent()
+            if spreading == "undefined":
+                spreading = False
             if self.Type == CONTACT_NORMAL:
                 spreading &= self.Value
             elif self.Type == CONTACT_REVERSE: