Fix a crash that got recently introduced.

When CFileSystemGCWii::GetFileName can't find a valid filename it would return nullptr.
nullptr as a std::string throws an assert within the std lib.
So return an empty string and check if it is empty or not
This commit is contained in:
Ryan Houdek 2014-03-23 22:29:30 -05:00
parent 9849129b5d
commit 5310d6d2ea
2 changed files with 4 additions and 1 deletions

View File

@ -143,6 +143,9 @@ void FindFilename(u64 offset)
}
const std::string filename = pFileSystem->GetFileName(offset);
if (filename.empty())
return;
CheckFile(filename, pFileSystem->GetFileSize(filename));
}

View File

@ -60,7 +60,7 @@ const std::string CFileSystemGCWii::GetFileName(u64 _Address)
}
}
return nullptr;
return "";
}
u64 CFileSystemGCWii::ReadFile(const std::string& _rFullPath, u8* _pBuffer, size_t _MaxBufferSize)