1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix possible crash on accessing faction description

This commit is contained in:
Ivan Savenko 2024-05-12 20:24:09 +00:00
parent 2f4da1f124
commit 0aa7362adf
2 changed files with 2 additions and 2 deletions

View File

@ -466,7 +466,7 @@ void CInteractableTownTooltip::init(const CGTownInstance * town)
if(town->id == townId && town->builtBuildings.count(BuildingID::TAVERN))
LOCPLINT->showTavernWindow(town, nullptr, QueryID::NONE);
}
}, [&]{
}, [town]{
if(!town->town->faction->getDescriptionTranslated().empty())
CRClickPopup::createAndPush(town->town->faction->getDescriptionTranslated());
});

View File

@ -1351,7 +1351,7 @@ void CCastleInterface::recreateIcons()
{
if(town->builtBuildings.count(BuildingID::TAVERN))
LOCPLINT->showTavernWindow(town, nullptr, QueryID::NONE);
}, [&]{
}, [this]{
if(!town->town->faction->getDescriptionTranslated().empty())
CRClickPopup::createAndPush(town->town->faction->getDescriptionTranslated());
});