diff options
Diffstat (limited to 'src/libs/engine')
-rw-r--r-- | src/libs/engine/events/ConnectionEvent.cpp | 14 | ||||
-rw-r--r-- | src/libs/engine/events/ConnectionEvent.h | 1 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/libs/engine/events/ConnectionEvent.cpp b/src/libs/engine/events/ConnectionEvent.cpp index af35265b..7c4b4422 100644 --- a/src/libs/engine/events/ConnectionEvent.cpp +++ b/src/libs/engine/events/ConnectionEvent.cpp @@ -84,16 +84,14 @@ ConnectionEvent::pre_process() return; } - /*if ( !( _src_port->is_output() && _dst_port->is_input() ) ) { - _error = TYPE_MISMATCH; - QueuedEvent::pre_process(); - return; - }*/ - _dst_input_port = dynamic_cast<InputPort*>(_dst_port); _src_output_port = dynamic_cast<OutputPort*>(_src_port); - assert(_src_output_port); - assert(_dst_input_port); + + if (!_dst_input_port || !_src_output_port) { + _error = DIRECTION_MISMATCH; + QueuedEvent::pre_process(); + return; + } if (_dst_input_port->is_connected_to(_src_output_port)) { _error = ALREADY_CONNECTED; diff --git a/src/libs/engine/events/ConnectionEvent.h b/src/libs/engine/events/ConnectionEvent.h index 8f5e1cc2..bebb6cfd 100644 --- a/src/libs/engine/events/ConnectionEvent.h +++ b/src/libs/engine/events/ConnectionEvent.h @@ -61,6 +61,7 @@ private: PARENT_PATCH_DIFFERENT, PORT_NOT_FOUND, TYPE_MISMATCH, + DIRECTION_MISMATCH, ALREADY_CONNECTED, PARENTS_NOT_FOUND }; |