repo git: catch any exceptions trying to parse transfer speeds
This commit is contained in:
parent
a5652d925e
commit
2e73338337
|
@ -252,11 +252,16 @@ namespace SparkleLib.Git {
|
||||||
s = s.Replace ("KiB/s", "ᴋʙ/s");
|
s = s.Replace ("KiB/s", "ᴋʙ/s");
|
||||||
s = s.Replace ("MiB/s", "ᴍʙ/s");
|
s = s.Replace ("MiB/s", "ᴍʙ/s");
|
||||||
|
|
||||||
|
try {
|
||||||
if (line.Contains ("KiB/s"))
|
if (line.Contains ("KiB/s"))
|
||||||
speed = double.Parse (s);
|
speed = double.Parse (s);
|
||||||
|
|
||||||
if (line.Contains ("MiB/s"))
|
if (line.Contains ("MiB/s"))
|
||||||
speed = double.Parse (s);
|
speed = double.Parse (s);
|
||||||
|
|
||||||
|
} catch {
|
||||||
|
speed = 0.0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,11 +345,16 @@ namespace SparkleLib.Git {
|
||||||
s = s.Replace ("KiB/s", "ᴋʙ/s");
|
s = s.Replace ("KiB/s", "ᴋʙ/s");
|
||||||
s = s.Replace ("MiB/s", "ᴍʙ/s");
|
s = s.Replace ("MiB/s", "ᴍʙ/s");
|
||||||
|
|
||||||
|
try {
|
||||||
if (line.Contains ("KiB/s"))
|
if (line.Contains ("KiB/s"))
|
||||||
speed = double.Parse (s);
|
speed = double.Parse (s);
|
||||||
|
|
||||||
if (line.Contains ("MiB/s"))
|
if (line.Contains ("MiB/s"))
|
||||||
speed = double.Parse (s);
|
speed = double.Parse (s);
|
||||||
|
|
||||||
|
} catch {
|
||||||
|
speed = 0.0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue