OSDN Git Service

na-get-lib,r987で仕込んでしまった0割り例外取りこぼしの対処。
[applistation/AppliStation.git] / na-get-lib / NaGet.Net / Downloader.cs
index 9fab357..17dc4de 100644 (file)
@@ -277,7 +277,7 @@ public class Downloader : NaGetTask
                                        \r
                                        if (stopwatch != null && stopwatch.IsRunning && stopwatch.ElapsedMilliseconds > 3000) {\r
                                                long bpers = e.DownloadSize * 1000 / stopwatch.ElapsedMilliseconds;\r
                                        \r
                                        if (stopwatch != null && stopwatch.IsRunning && stopwatch.ElapsedMilliseconds > 3000) {\r
                                                long bpers = e.DownloadSize * 1000 / stopwatch.ElapsedMilliseconds;\r
-                                               if (e.TaskProgressPercent >= 0) {\r
+                                               if ((e.TaskProgressPercent >= 0) && (bpers > 0)) {\r
                                                        TimeSpan rest = TimeSpan.FromSeconds((max - e.DownloadSize) / bpers);\r
                                                        e.TaskMessage += string.Format(" 推定残り時間:{0} ({1}/s)", rest, NaGet.Utils.FormatSize(bpers));\r
                                                } else {\r
                                                        TimeSpan rest = TimeSpan.FromSeconds((max - e.DownloadSize) / bpers);\r
                                                        e.TaskMessage += string.Format(" 推定残り時間:{0} ({1}/s)", rest, NaGet.Utils.FormatSize(bpers));\r
                                                } else {\r