EXI_SLIPPI: in case the dirpath is deleted after launch (#28)

Co-authored-by: Nikhil Narayana <nikhil.narayana@live.com>
This commit is contained in:
Edgar Handal 2020-07-13 18:08:37 -05:00 committed by R2DLiu
commit 417a890a7e

View file

@ -497,6 +497,12 @@ void CEXISlippi::createNewFile()
}
std::string dirpath = SConfig::GetInstance().m_strSlippiReplayDir;
// in case the config value just gets lost somehow
if (dirpath.empty())
{
SConfig::GetInstance().m_strSlippiReplayDir = File::GetHomeDirectory() + DIR_SEP + "Slippi";
dirpath = SConfig::GetInstance().m_strSlippiReplayDir;
}
// Remove a trailing / or \\ if the user managed to have that in their config
char dirpathEnd = dirpath.back();