#136: avoid crash in par-renamer

if the directory content could not be read.
This commit is contained in:
Andrey Prygunkov
2015-12-28 11:05:52 +01:00
parent 03ba670d36
commit f347f1aed1

View File

@@ -229,7 +229,7 @@ void ParRenamer::CheckFiles(const char* destDir, bool renamePars)
if (!FileSystem::DirectoryExists(fullFilename))
{
m_progressLabel.Format("Checking file %s", filename);
m_stageProgress = m_curFile * 1000 / m_fileCount;
m_stageProgress = m_fileCount > 0 ? m_curFile * 1000 / m_fileCount : 1000;
UpdateProgress();
m_curFile++;