Fixing a divide by zero

This commit is contained in:
Rick Falkvinge
2017-10-01 17:36:52 +02:00
parent f959357ab2
commit 44901c7a35
+1 -1
View File
@@ -235,7 +235,7 @@ namespace Swarmops.Frontend.Socket
// If first page hasn't appeared yet, check for the Magick temp files
int currentMagickCount = Directory.GetFiles("/tmp", "magick-*").Count();
int currentFilePercentage = currentMagickCount*50/pageCounter;
int currentFilePercentage = currentMagickCount*50/currentFilePageCount;
if (currentFilePercentage > 50)
{
currentFilePercentage = 50; // we may be not the only one converting right now