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

#1409 should not crash anymore.

Fixed crash on serializing empty path. [How did it got there...?]
operator<< for boost::optional.
This commit is contained in:
Michał W. Urbańczyk
2013-08-18 15:46:28 +00:00
parent 2e92bfb617
commit 3b42cff3ec
5 changed files with 69 additions and 6 deletions

View File

@@ -1183,7 +1183,12 @@ template <typename Handler> void CPlayerInterface::serializeTempl( Handler &h, c
if(h.saving)
{
for(auto &p : paths)
pathsMap[p.first] = p.second.endPos();
{
if(p.second.nodes.size())
pathsMap[p.first] = p.second.endPos();
else
logGlobal->errorStream() << p.first->name << " has assigned an empty path! Ignoring it...";
}
h & pathsMap;
}
else