mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:29:50 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user