diff --git a/src/ui/DebugConsole.cc b/src/ui/DebugConsole.cc index 4fd14e42fd99b3be0f38ee205b67781d3bd9b3c5..7b0026fd9c581584f7c94381d8d68c167fb97f49 100644 --- a/src/ui/DebugConsole.cc +++ b/src/ui/DebugConsole.cc @@ -228,12 +228,14 @@ void DebugConsole::linkSelected(int linkId) m_ui->receiveText->clear(); // Connect new link - currLink = links[linkId]; - connect(currLink, SIGNAL(bytesReceived(LinkInterface*,QByteArray)), this, SLOT(receiveBytes(LinkInterface*, QByteArray))); - connect(currLink, SIGNAL(connected(bool)), this, SLOT(setConnectionState(bool))); - connect(currLink,SIGNAL(communicationUpdate(QString,QString)),this,SLOT(linkStatusUpdate(QString,QString))); - setConnectionState(currLink->isConnected()); - snapShotTimer.start(); + if (linkId != -1) { + currLink = links[linkId]; + connect(currLink, SIGNAL(bytesReceived(LinkInterface*,QByteArray)), this, SLOT(receiveBytes(LinkInterface*, QByteArray))); + connect(currLink, SIGNAL(connected(bool)), this, SLOT(setConnectionState(bool))); + connect(currLink,SIGNAL(communicationUpdate(QString,QString)),this,SLOT(linkStatusUpdate(QString,QString))); + setConnectionState(currLink->isConnected()); + snapShotTimer.start(); + } } /**