Explorar o código

Fix specific situation with link to self

Yentl Van Tendeloo %!s(int64=8) %!d(string=hai) anos
pai
achega
3f9ea3ed0a
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      interface/CBD/main.py

+ 2 - 0
interface/CBD/main.py

@@ -247,6 +247,8 @@ class InterfaceCore():
         if source and target:
             if self.mode not in ["Link", "InitialCondition"]:
                 print("Cannot create something not guaranteed to be link type!")
+            elif source == target:
+                print("Cannot create link to self")
             else:
                 global name
                 self.mv.instantiate_link(str(name), self.mode, source, target)