repo git: catch exceptions when parsing sync speed. fixes #1163
This commit is contained in:
parent
7ccca034f8
commit
5b43da1012
|
@ -280,8 +280,12 @@ namespace SparkleLib.Git {
|
|||
Match speed_match = this.speed_regex.Match (line);
|
||||
|
||||
if (speed_match.Success) {
|
||||
try {
|
||||
speed = double.Parse (speed_match.Groups [1].Value, new CultureInfo ("en-US")) * 1024;
|
||||
|
||||
} catch (FormatException) {
|
||||
}
|
||||
|
||||
if (speed_match.Groups [2].Value.Equals ("M"))
|
||||
speed = speed * 1024;
|
||||
}
|
||||
|
@ -362,8 +366,12 @@ namespace SparkleLib.Git {
|
|||
Match speed_match = this.speed_regex.Match (line);
|
||||
|
||||
if (speed_match.Success) {
|
||||
try {
|
||||
speed = double.Parse (speed_match.Groups [1].Value, new CultureInfo ("en-US")) * 1024;
|
||||
|
||||
} catch (FormatException) {
|
||||
}
|
||||
|
||||
if (speed_match.Groups [2].Value.Equals ("M"))
|
||||
speed = speed * 1024;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue