Pārlūkot izejas kodu

Bugfix: Check for divide by zero when calculating progress bar percentages

BearishSun 7 gadi atpakaļ
vecāks
revīzija
7e138ba415

+ 4 - 1
Source/Scripting/MBansheeEditor/Windows/Library/ProjectLibrary.cs

@@ -293,7 +293,10 @@ namespace BansheeEditor
             {
                 int numRemaining = totalFilesToImport - inProgressImports;
 
-                float pct = numRemaining / (float)totalFilesToImport;
+                float pct = 1.0f;
+                if(totalFilesToImport > 0)
+                    pct = numRemaining / (float)totalFilesToImport;
+
                 EditorApplication.SetStatusImporting(true, pct);
             }
             else