From beb23ea0c0897d6ab14258a752be0c1c77e92210 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sat, 20 Dec 2014 18:42:06 +0100 Subject: [PATCH] Extra check in component --- src/blackgui/components/cockpitcomcomponent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blackgui/components/cockpitcomcomponent.cpp b/src/blackgui/components/cockpitcomcomponent.cpp index 24fe35a94..484c4ec60 100644 --- a/src/blackgui/components/cockpitcomcomponent.cpp +++ b/src/blackgui/components/cockpitcomcomponent.cpp @@ -139,8 +139,8 @@ namespace BlackGui if (this->getIContextNetwork()) { CAtcStationList selectedStations = this->getIContextNetwork()->getSelectedAtcStations(); - CAtcStation com1Station = selectedStations[0]; - CAtcStation com2Station = selectedStations[1]; + CAtcStation com1Station = selectedStations.size() > 0 ? selectedStations[0] : CAtcStation(); + CAtcStation com2Station = selectedStations.size() > 1 ? selectedStations[1] : CAtcStation(); if (com1Station.getCallsign().isEmpty()) { this->ui->lbl_ComPanelCom1Active->setToolTip("");