Skip to content

Commit 226f1b4

Browse files
committed
Added error when passing invalid val for Data Version
1 parent 9e45f6c commit 226f1b4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

UnityPerformanceBenchmarkReporter/PerformanceBenchmark.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ private void AddTestResults(
134134
public void SetDataVersion(string version)
135135
{
136136
if(int.TryParse(version,out int result)){
137-
DataVersion = result;
137+
if(result > 0 && result < 3)
138+
DataVersion = result;
139+
else
140+
throw new ArgumentException($"{version} is not a valid data format version. Please pass 1 or 2");
138141
}else{
139142
throw new ArgumentException($"{version} is not a valid data format version");
140143
}

0 commit comments

Comments
 (0)