Skip to content

Commit

Permalink
Hotfix: Crash in getInitialATCContactInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
fpw committed Mar 1, 2020
1 parent 83bb2fa commit 8add2c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
4 changes: 2 additions & 2 deletions src/libxdata/world/models/airport/Airport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}
Expand Down

0 comments on commit 8add2c8

Please sign in to comment.