From 7310835d3ee3272df61b2d7bf775cc8734f68c4e Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko Date: Fri, 2 Feb 2024 11:01:59 +0300 Subject: [PATCH] Update Sender.Concepts.cs --- src/ReportPortal.GaugePlugin/Results/Sender.Concepts.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ReportPortal.GaugePlugin/Results/Sender.Concepts.cs b/src/ReportPortal.GaugePlugin/Results/Sender.Concepts.cs index ca1a935..2e9d1ec 100644 --- a/src/ReportPortal.GaugePlugin/Results/Sender.Concepts.cs +++ b/src/ReportPortal.GaugePlugin/Results/Sender.Concepts.cs @@ -20,7 +20,7 @@ public void StartConcept(ConceptExecutionStartingRequest request) { var scenarioKey = GetScenarioKey(request.CurrentExecutionInfo, request.CurrentExecutionInfo.CurrentSpec, request.CurrentExecutionInfo.CurrentScenario); - var parentReporter = _scenarioConcepts.ContainsKey(scenarioKey) ? _scenarioConcepts[scenarioKey].Last() : _scenarios[scenarioKey]; + var parentReporter = _scenarioConcepts.TryGetValue(scenarioKey, out var concepts) ? concepts.Last() : _scenarios[scenarioKey]; var conceptReporter = parentReporter.StartChildTestReporter(new StartTestItemRequest { @@ -29,7 +29,7 @@ public void StartConcept(ConceptExecutionStartingRequest request) HasStats = false }); - if (_scenarioConcepts.TryGetValue(scenarioKey, out List concepts)) + if (concepts is not null) { concepts.Add(conceptReporter); }