From b3a5076f39acc3fedd26f6ece66383694125d866 Mon Sep 17 00:00:00 2001 From: vng Date: Wed, 2 Oct 2013 12:51:57 +0300 Subject: [PATCH] Fix bug with invalid country index. --- map/country_status_display.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/map/country_status_display.cpp b/map/country_status_display.cpp index 9feb916eab..06254d4845 100644 --- a/map/country_status_display.cpp +++ b/map/country_status_display.cpp @@ -70,7 +70,7 @@ void CountryStatusDisplay::cache() string const dn = displayName(); - if (m_countryIdx != storage::TIndex()) + if (m_countryIdx.IsValid()) { switch (m_countryStatus) { @@ -239,12 +239,15 @@ void CountryStatusDisplay::setCountryIndex(storage::TIndex const & idx) { m_countryIdx = idx; - m_storage->GetGroupAndCountry(idx, m_mapGroupName, m_mapName); - LOG(LDEBUG, (m_mapName, m_mapGroupName)); + if (m_countryIdx.IsValid()) + { + m_storage->GetGroupAndCountry(idx, m_mapGroupName, m_mapName); + LOG(LDEBUG, (m_mapName, m_mapGroupName)); - UpdateStatusAndProgress(); + UpdateStatusAndProgress(); - m_notEnoughSpace = false; + m_notEnoughSpace = false; + } setIsDirtyLayout(true); invalidate();