Skip to content

Commit 33056d2

Browse files
Handle null checks and improve exception logging in TestCaseFilter
1 parent 2d1ade1 commit 33056d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/BenchmarkDotNet.TestAdapter/Utility/TestCaseFilter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ private bool GetTestCaseFilterExpressionFromDiscoveryContext(IDiscoveryContext d
132132
}
133133
catch (TargetInvocationException e)
134134
{
135-
if (e?.InnerException is TestPlatformException ex)
135+
if (e.InnerException is TestPlatformException ex)
136136
{
137-
logger.LogWarning("Exception filtering tests: {0}", ex.InnerException.Message ?? "");
137+
logger.LogWarning("Exception filtering tests: {0}", ex.Message);
138138
return false;
139139
}
140140

141-
throw e!.InnerException;
141+
throw e.InnerException ?? e;
142142
}
143143
}
144144
}

0 commit comments

Comments
 (0)