From 8add2c8a60d17f812b4c7e713dfd709475839b18 Mon Sep 17 00:00:00 2001 From: Folke Will Date: Sun, 1 Mar 2020 22:34:44 +0100 Subject: [PATCH] Hotfix: Crash in getInitialATCContactInfo --- CMakeLists.txt | 2 +- src/libxdata/world/models/airport/Airport.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9aba62c9..b5ff776c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.9) -project(AviTab VERSION 0.4.1 DESCRIPTION "AviTab X-Plane plugin") +project(AviTab VERSION 0.3.18 DESCRIPTION "AviTab X-Plane plugin") if (NOT "$ENV{NAVIGRAPH_SECRET}" STREQUAL "") set(NAVIGRAPH_SECRET "$ENV{NAVIGRAPH_SECRET}" CACHE INTERNAL "Copied from environment variable") diff --git a/src/libxdata/world/models/airport/Airport.cpp b/src/libxdata/world/models/airport/Airport.cpp index 279f6887..d2292ab8 100644 --- a/src/libxdata/world/models/airport/Airport.cpp +++ b/src/libxdata/world/models/airport/Airport.cpp @@ -299,7 +299,7 @@ std::string Airport::getInitialATCContactInfo() const { }; std::string initialATCContact = ""; for (auto atcType: prioritisedATCType) { - if (atcFrequencies.count(atcType) > 0) { + if (atcFrequencies.count(atcType) > 0 && !atcFrequencies.at(atcType).empty()) { std::string desc; switch(atcType) { case(xdata::Airport::ATCFrequency::RECORDED): desc = "ATIS"; break; @@ -311,7 +311,7 @@ std::string Airport::getInitialATCContactInfo() const { case(xdata::Airport::ATCFrequency::GND): desc = "GND"; break; default: desc = ""; break; } - initialATCContact = desc + "-" + atcFrequencies.at(atcType)[0].getFrequencyString(false); + initialATCContact = desc + "-" + atcFrequencies.at(atcType).at(0).getFrequencyString(false); break; } }