Skip to content

Commit 9934cff

Browse files
committed
apply copilot comments
1 parent 26cdf12 commit 9934cff

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/coverlet.core/Instrumentation/CecilAssemblyResolver.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,10 @@ public RuntimeConfigurationReader(string runtimeConfigFile)
304304
using var configuration = JsonDocument.Parse(jsonString, documentOptions);
305305

306306
JsonElement rootElement = configuration.RootElement;
307-
JsonElement runtimeOptionsElement = rootElement.GetProperty("runtimeOptions");
307+
if (!rootElement.TryGetProperty("runtimeOptions", out JsonElement runtimeOptionsElement))
308+
{
309+
throw new InvalidOperationException($"The 'runtimeOptions' property is missing in the runtime configuration file {_runtimeConfigFile}.");
310+
}
308311

309312
if (runtimeOptionsElement.TryGetProperty("framework", out JsonElement frameworkElement))
310313
{

test/coverlet.integration.tests/DeterministicBuild.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private void CreateDeterministicTestPropsFile()
4949
_testProjectTfm = XElement.Load(Path.Combine(_testProjectPath, "coverlet.integration.determisticbuild.csproj"))!.
5050
Descendants("PropertyGroup")!.Single().Element("TargetFramework")!.Value;
5151

52-
deterministicTestProps.Save(Path.Combine(propsFile));
52+
deterministicTestProps.Save(propsFile);
5353
}
5454

5555
private protected void AssertCoverage(string standardOutput = "", bool checkDeterministicReport = true)

0 commit comments

Comments
 (0)