Fix wrong errormessage in case of encountering a broken replay.

This was SVN commit r17567.
This commit is contained in:
elexis
2015-12-29 14:00:30 +00:00
parent f8ec158116
commit 9f65e90b60
+7 -1
View File
@@ -181,12 +181,18 @@ JS::Value VisualReplay::LoadReplayData(ScriptInterface& scriptInterface, OsPath&
// File must begin with "start"
CStr type;
if (!(*replayStream >> type).good() || type != "start")
if (!(*replayStream >> type).good())
{
LOGERROR("Couldn't open %s. Non-latin characters are not supported yet.", fileName.c_str());
SAFE_DELETE(replayStream);
return JSVAL_NULL;
}
if (type != "start")
{
LOGWARNING("The replay %s is broken!", fileName.c_str());
SAFE_DELETE(replayStream);
return JSVAL_NULL;
}
// Parse header / first line
CStr header;