Explorar el Código

Put in safety check to prevent crash in Modelverse GUI

Yentl Van Tendeloo hace 8 años
padre
commit
2fc51ca4c9
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/python_sccd/python_sccd_runtime/statecharts_core.py

+ 2 - 1
src/python_sccd/python_sccd_runtime/statecharts_core.py

@@ -162,7 +162,8 @@ class ObjectManagerBase(object):
 
     def step(self):
         while self.events.getEarliestTime() <= self.controller.simulated_time:
-            self.handleEvent(self.events.pop())
+            if self.events:
+                self.handleEvent(self.events.pop())
                
     def start(self):
         for i in self.instances: