Explorar el Código

Fix: 0-length Schema poisons exeuction without error

Joseph Brandenburg hace 6 meses
padre
commit
df6f4b8638
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      schema_solve.py

+ 6 - 1
schema_solve.py

@@ -621,8 +621,13 @@ class SchemaSolver:
         
     def solve(self):
         if self.solve_length < 1:
+            from .base_definitions import GraphError
+            for o in self.node.outputs:
+                if o.is_linked:
+                    raise GraphError(f"ERROR: Schema {self.signature} has a length"
+                                     " of 0 but other nodes depend on it.")
             print (f"WARN: Schema {self.signature} has a length of 0 or less and will not expand.")
-            return {} # just don't do anything. This may cause errors if the Schema has dependencies - that's OK.
+            return {} # just don't do anything - it's OK to have a noop schema if it doesn't have dependencies.
         for index in range(self.solve_length):
             self.index = index
             frame_mantis_nodes = self.solve_iteration()