Skip to content

Commit 627053e

Browse files
authored
Fix parsing of version field when decimal separator is not "." (#12)
1 parent 959b1a0 commit 627053e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

UnityMixedCallstackFilter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ private static void RefreshStackData(int pid)
119119
if (tokens.Length != 2)
120120
throw new Exception("Failed reading input file " + fileName + ": Incorrect format");
121121

122-
var version = double.Parse(tokens[1]);
122+
if (!double.TryParse(tokens[1], NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var version))
123+
throw new Exception("Failed reading input file " + fileName + ": Incorrect version format");
123124

124125
if(version > 1.0)
125126
throw new Exception("Failed reading input file " + fileName + ": A newer version of UnityMixedCallstacks plugin is required to read this file");

0 commit comments

Comments
 (0)