Skip to content

Commit b708b89

Browse files
NyakoFoxflibitijibibo
authored andcommitted
Fix empty roomnames potentially crashing the game
TinyXML2 seems to sometimes return NULL when an element has either no text or whitespace, instead of returning an empty string. Why it does this, I'm not sure, but I have recently learned from Dav999 that it will crash the game. Great.
1 parent 30bdb47 commit b708b89

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

desktop_version/src/CustomLevels.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,10 @@ bool customlevelclass::load(std::string _path)
13871387
{
13881388
name.text.push_back(std::string(text));
13891389
}
1390+
else
1391+
{
1392+
name.text.push_back(std::string(""));
1393+
}
13901394
}
13911395
else
13921396
{
@@ -1404,6 +1408,10 @@ bool customlevelclass::load(std::string _path)
14041408
{
14051409
name.text.push_back(std::string(text));
14061410
}
1411+
else
1412+
{
1413+
name.text.push_back(std::string(""));
1414+
}
14071415
}
14081416
}
14091417
}

0 commit comments

Comments
 (0)