Don't throw errors and hide the summary screen button when encountering an empty replay metadata file.

That kind of file can be written in case the partition has no more space
left when ending the game.

This was SVN commit r18560.
This commit is contained in:
elexis
2016-07-25 11:26:56 +00:00
parent e262e021b0
commit a0058c533b
+9 -1
View File
@@ -310,7 +310,15 @@ void VisualReplay::SaveReplayMetadata(const CStrW& data)
bool VisualReplay::HasReplayMetadata(const CStrW& directoryName)
{
return FileExists(GetDirectoryName() / directoryName / L"metadata.json");
const OsPath filePath(GetDirectoryName() / directoryName / L"metadata.json");
if (!FileExists(filePath))
return false;
CFileInfo fileInfo;
GetFileInfo(filePath, &fileInfo);
return fileInfo.Size() > 0;
}
JS::Value VisualReplay::GetReplayMetadata(ScriptInterface::CxPrivate* pCxPrivate, const CStrW& directoryName)