Fix bug #21967: fix crash when unit modification to traits has empty id
This commit is contained in:
parent
39a1488ff5
commit
0aebc80e5e
2 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
Version 1.11.13+dev:
|
||||
* Language and i18n:
|
||||
* Updated translations:
|
||||
* Fix bug #21967: fix crash when unit modification to traits has empty id
|
||||
|
||||
Version 1.11.13:
|
||||
* AI:
|
||||
|
|
|
@ -742,8 +742,9 @@ std::vector<std::string> unit::get_traits_list() const
|
|||
BOOST_FOREACH(const config &mod, modifications_.child_range("trait"))
|
||||
{
|
||||
std::string const &id = mod["id"];
|
||||
if (!id.empty())
|
||||
res.push_back(id);
|
||||
// Make sure to return empty id trait strings as otherwise
|
||||
// names will not match in length (Bug #21967)
|
||||
res.push_back(id);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue