Browse Source

Add a safety check for whether the EventLoop object is actually an EventLoop object...

Yentl Van Tendeloo 7 years ago
parent
commit
2ca197206e
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/python_sccd/python_sccd_runtime/statecharts_core.py

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

@@ -562,6 +562,8 @@ class EventLoop:
 class EventLoopControllerBase(ControllerBase):
     def __init__(self, object_manager, event_loop, finished_callback = None, behind_schedule_callback = None):
         ControllerBase.__init__(self, object_manager)
+        if not isinstance(event_loop, EventLoop):
+            raise RuntimeException("Event loop argument must be an instance of the EventLoop class!")
         self.event_loop = event_loop
         self.finished_callback = finished_callback
         self.behind_schedule_callback = behind_schedule_callback