From f347f1aed1070c60dbf54a7222be8564bf3f3cf0 Mon Sep 17 00:00:00 2001 From: Andrey Prygunkov Date: Mon, 28 Dec 2015 11:05:52 +0100 Subject: [PATCH] #136: avoid crash in par-renamer if the directory content could not be read. --- daemon/postprocess/ParRenamer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/postprocess/ParRenamer.cpp b/daemon/postprocess/ParRenamer.cpp index 20fb2fae..65fd8796 100644 --- a/daemon/postprocess/ParRenamer.cpp +++ b/daemon/postprocess/ParRenamer.cpp @@ -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++;